SslRMIServerSocketFactory (Java 2 Platform SE 5.0) (original) (raw)


javax.rmi.ssl

Class SslRMIServerSocketFactory

java.lang.Object extended by javax.rmi.ssl.SslRMIServerSocketFactory

All Implemented Interfaces:

RMIServerSocketFactory


public class SslRMIServerSocketFactory

extends Object

implements RMIServerSocketFactory

An SslRMIServerSocketFactory instance is used by the RMI runtime in order to obtain server sockets for RMI calls via SSL.

This class implements RMIServerSocketFactory over the Secure Sockets Layer (SSL) or Transport Layer Security (TLS) protocols.

This class creates SSL sockets using the defaultSSLSocketFactory (see SSLSocketFactory.getDefault()) or the defaultSSLServerSocketFactory (see SSLServerSocketFactory.getDefault()). Therefore, all instances of this class share the same keystore, and the same truststore, when client authentication is required by the server. This behavior can be modified in subclasses by overriding the createServerSocket(int) method; in that case, equals and hashCode may also need to be overridden.

Since:

1.5

See Also:

SSLSocketFactory, SSLServerSocketFactory, SslRMIClientSocketFactory


Constructor Summary
SslRMIServerSocketFactory() Creates a new SslRMIServerSocketFactory with the default SSL socket configuration.
[SslRMIServerSocketFactory](../../../javax/rmi/ssl/SslRMIServerSocketFactory.html#SslRMIServerSocketFactory%28java.lang.String[], java.lang.String[], boolean%29)(String[] enabledCipherSuites,String[] enabledProtocols, boolean needClientAuth) Creates a new SslRMIServerSocketFactory with the specified SSL socket configuration.
Method Summary
ServerSocket createServerSocket(int port) Creates a server socket that accepts SSL connections configured according to this factory's SSL socket configuration parameters.
boolean equals(Object obj) Indicates whether some other object is "equal to" this one.
String[] getEnabledCipherSuites() Returns the names of the cipher suites enabled on SSL connections accepted by server sockets created by this factory, or null if this factory uses the cipher suites that are enabled by default.
String[] getEnabledProtocols() Returns the names of the protocol versions enabled on SSL connections accepted by server sockets created by this factory, or null if this factory uses the protocol versions that are enabled by default.
boolean getNeedClientAuth() Returns true if client authentication is required on SSL connections accepted by server sockets created by this factory.
int hashCode() Returns a hash code value for thisSslRMIServerSocketFactory.
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, [wait](../../../java/lang/Object.html#wait%28long, int%29)
Constructor Detail

SslRMIServerSocketFactory

public SslRMIServerSocketFactory()

Creates a new SslRMIServerSocketFactory with the default SSL socket configuration.

SSL connections accepted by server sockets created by this factory have the default cipher suites and protocol versions enabled and do not require client authentication.


SslRMIServerSocketFactory

public SslRMIServerSocketFactory(String[] enabledCipherSuites, String[] enabledProtocols, boolean needClientAuth) throws IllegalArgumentException

Creates a new SslRMIServerSocketFactory with the specified SSL socket configuration.

Parameters:

enabledCipherSuites - names of all the cipher suites to enable on SSL connections accepted by server sockets created by this factory, or null to use the cipher suites that are enabled by default

enabledProtocols - names of all the protocol versions to enable on SSL connections accepted by server sockets created by this factory, or null to use the protocol versions that are enabled by default

needClientAuth - true to require client authentication on SSL connections accepted by server sockets created by this factory; false to not require client authentication

Throws:

[IllegalArgumentException](../../../java/lang/IllegalArgumentException.html "class in java.lang") - when one or more of the cipher suites named by the enabledCipherSuites parameter is not supported, when one or more of the protocols named by theenabledProtocols parameter is not supported or when a problem is encountered while trying to check if the supplied cipher suites and protocols to be enabled are supported.

See Also:

SSLSocket.setEnabledCipherSuites(java.lang.String[]), SSLSocket.setEnabledProtocols(java.lang.String[]), SSLSocket.setNeedClientAuth(boolean)

Method Detail

getEnabledCipherSuites

public final String[] getEnabledCipherSuites()

Returns the names of the cipher suites enabled on SSL connections accepted by server sockets created by this factory, or null if this factory uses the cipher suites that are enabled by default.

Returns:

an array of cipher suites enabled, or null

See Also:

SSLSocket.setEnabledCipherSuites(java.lang.String[])


getEnabledProtocols

public final String[] getEnabledProtocols()

Returns the names of the protocol versions enabled on SSL connections accepted by server sockets created by this factory, or null if this factory uses the protocol versions that are enabled by default.

Returns:

an array of protocol versions enabled, ornull

See Also:

SSLSocket.setEnabledProtocols(java.lang.String[])


getNeedClientAuth

public final boolean getNeedClientAuth()

Returns true if client authentication is required on SSL connections accepted by server sockets created by this factory.

Returns:

true if client authentication is required

See Also:

SSLSocket.setNeedClientAuth(boolean)


createServerSocket

public ServerSocket createServerSocket(int port) throws IOException

Creates a server socket that accepts SSL connections configured according to this factory's SSL socket configuration parameters.

Specified by:

[createServerSocket](../../../java/rmi/server/RMIServerSocketFactory.html#createServerSocket%28int%29) in interface [RMIServerSocketFactory](../../../java/rmi/server/RMIServerSocketFactory.html "interface in java.rmi.server")

Parameters:

port - the port number

Returns:

the server socket on the specified port

Throws:

[IOException](../../../java/io/IOException.html "class in java.io") - if an I/O error occurs during server socket creation


equals

public boolean equals(Object obj)

Indicates whether some other object is "equal to" this one.

Two SslRMIServerSocketFactory objects are equal if they have been constructed with the same SSL socket configuration parameters.

A subclass should override this method (as well ashashCode()) if it adds instance state that affects equality.

Overrides:

[equals](../../../java/lang/Object.html#equals%28java.lang.Object%29) in class [Object](../../../java/lang/Object.html "class in java.lang")

Parameters:

obj - the reference object with which to compare.

Returns:

true if this object is the same as the obj argument; false otherwise.

See Also:

Object.hashCode(), Hashtable


hashCode

public int hashCode()

Returns a hash code value for thisSslRMIServerSocketFactory.

Overrides:

[hashCode](../../../java/lang/Object.html#hashCode%28%29) in class [Object](../../../java/lang/Object.html "class in java.lang")

Returns:

a hash code value for thisSslRMIServerSocketFactory.

See Also:

Object.equals(java.lang.Object), Hashtable



Submit a bug or feature
For further API reference and developer documentation, see Java 2 SDK SE Developer Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.

Copyright © 2004, 2010 Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.