javax.rmi.ssl
Class SslRMIServerSocketFactory

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by javax.rmi.ssl.SslRMIServerSocketFactory
All Implemented Interfaces:
RMIServerSocketFactory sample code for java.rmi.server.RMIServerSocketFactory definition code for java.rmi.server.RMIServerSocketFactory

public class SslRMIServerSocketFactory
extends Object sample code for java.lang.Object definition code for java.lang.Object
implements RMIServerSocketFactory sample code for java.rmi.server.RMIServerSocketFactory definition code for java.rmi.server.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 default SSLSocketFactory (see SSLSocketFactory.getDefault()) or the default SSLServerSocketFactory (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) sample code for javax.rmi.ssl.SslRMIServerSocketFactory.createServerSocket(int) definition code for javax.rmi.ssl.SslRMIServerSocketFactory.createServerSocket(int) method; in that case, equals sample code for javax.rmi.ssl.SslRMIServerSocketFactory.equals(java.lang.Object) definition code for javax.rmi.ssl.SslRMIServerSocketFactory.equals(java.lang.Object) and hashCode sample code for javax.rmi.ssl.SslRMIServerSocketFactory.hashCode() definition code for javax.rmi.ssl.SslRMIServerSocketFactory.hashCode() may also need to be overridden.

Since:
1.5
See Also:
SSLSocketFactory, SSLServerSocketFactory, SslRMIClientSocketFactory sample code for javax.rmi.ssl.SslRMIClientSocketFactory definition code for javax.rmi.ssl.SslRMIClientSocketFactory

Constructor Summary
SslRMIServerSocketFactory sample code for javax.rmi.ssl.SslRMIServerSocketFactory.SslRMIServerSocketFactory() definition code for javax.rmi.ssl.SslRMIServerSocketFactory.SslRMIServerSocketFactory() ()
          Creates a new SslRMIServerSocketFactory with the default SSL socket configuration.
SslRMIServerSocketFactory sample code for javax.rmi.ssl.SslRMIServerSocketFactory.SslRMIServerSocketFactory(java.lang.String[], java.lang.String[], boolean) definition code for javax.rmi.ssl.SslRMIServerSocketFactory.SslRMIServerSocketFactory(java.lang.String[], java.lang.String[], boolean) (String sample code for java.lang.String definition code for java.lang.String [] enabledCipherSuites, String sample code for java.lang.String definition code for java.lang.String [] enabledProtocols, boolean needClientAuth)
          Creates a new SslRMIServerSocketFactory with the specified SSL socket configuration.
 
Method Summary
 ServerSocket sample code for java.net.ServerSocket definition code for java.net.ServerSocket createServerSocket sample code for javax.rmi.ssl.SslRMIServerSocketFactory.createServerSocket(int) definition code for javax.rmi.ssl.SslRMIServerSocketFactory.createServerSocket(int) (int port)
          Creates a server socket that accepts SSL connections configured according to this factory's SSL socket configuration parameters.
 boolean equals sample code for javax.rmi.ssl.SslRMIServerSocketFactory.equals(java.lang.Object) definition code for javax.rmi.ssl.SslRMIServerSocketFactory.equals(java.lang.Object) (Object sample code for java.lang.Object definition code for java.lang.Object  obj)
          Indicates whether some other object is "equal to" this one.
 String sample code for java.lang.String definition code for java.lang.String [] getEnabledCipherSuites sample code for javax.rmi.ssl.SslRMIServerSocketFactory.getEnabledCipherSuites() definition code for javax.rmi.ssl.SslRMIServerSocketFactory.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 sample code for java.lang.String definition code for java.lang.String [] getEnabledProtocols sample code for javax.rmi.ssl.SslRMIServerSocketFactory.getEnabledProtocols() definition code for javax.rmi.ssl.SslRMIServerSocketFactory.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 sample code for javax.rmi.ssl.SslRMIServerSocketFactory.getNeedClientAuth() definition code for javax.rmi.ssl.SslRMIServerSocketFactory.getNeedClientAuth() ()
          Returns true if client authentication is required on SSL connections accepted by server sockets created by this factory.
 int hashCode sample code for javax.rmi.ssl.SslRMIServerSocketFactory.hashCode() definition code for javax.rmi.ssl.SslRMIServerSocketFactory.hashCode() ()
          Returns a hash code value for this SslRMIServerSocketFactory.
 
Methods inherited from class java.lang.Object sample code for java.lang.Object definition code for java.lang.Object
clone sample code for java.lang.Object.clone() definition code for java.lang.Object.clone() , finalize sample code for java.lang.Object.finalize() definition code for java.lang.Object.finalize() , getClass sample code for java.lang.Object.getClass() definition code for java.lang.Object.getClass() , notify sample code for java.lang.Object.notify() definition code for java.lang.Object.notify() , notifyAll sample code for java.lang.Object.notifyAll() definition code for java.lang.Object.notifyAll() , toString sample code for java.lang.Object.toString() definition code for java.lang.Object.toString() , wait sample code for java.lang.Object.wait() definition code for java.lang.Object.wait() , wait sample code for java.lang.Object.wait(long) definition code for java.lang.Object.wait(long) , wait sample code for java.lang.Object.wait(long, int) definition code for java.lang.Object.wait(long, int)
 

Constructor Detail

SslRMIServerSocketFactory sample code for javax.rmi.ssl.SslRMIServerSocketFactory() definition code for javax.rmi.ssl.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 sample code for javax.rmi.ssl.SslRMIServerSocketFactory(java.lang.String[], java.lang.String[], boolean) definition code for javax.rmi.ssl.SslRMIServerSocketFactory(java.lang.String[], java.lang.String[], boolean)

public SslRMIServerSocketFactory(String sample code for java.lang.String definition code for java.lang.String [] enabledCipherSuites,
                                 String sample code for java.lang.String definition code for java.lang.String [] enabledProtocols,
                                 boolean needClientAuth)
                          throws IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.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 sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - 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 the enabledProtocols 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 sample code for javax.rmi.ssl.SslRMIServerSocketFactory.getEnabledCipherSuites() definition code for javax.rmi.ssl.SslRMIServerSocketFactory.getEnabledCipherSuites()

public final String sample code for java.lang.String definition code for java.lang.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 sample code for javax.rmi.ssl.SslRMIServerSocketFactory.getEnabledProtocols() definition code for javax.rmi.ssl.SslRMIServerSocketFactory.getEnabledProtocols()

public final String sample code for java.lang.String definition code for java.lang.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, or null
See Also:
SSLSocket.setEnabledProtocols(java.lang.String[])

getNeedClientAuth sample code for javax.rmi.ssl.SslRMIServerSocketFactory.getNeedClientAuth() definition code for javax.rmi.ssl.SslRMIServerSocketFactory.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 sample code for javax.rmi.ssl.SslRMIServerSocketFactory.createServerSocket(int) definition code for javax.rmi.ssl.SslRMIServerSocketFactory.createServerSocket(int)

public ServerSocket sample code for java.net.ServerSocket definition code for java.net.ServerSocket  createServerSocket(int port)
                                throws IOException sample code for java.io.IOException definition code for java.io.IOException 

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

Specified by:
createServerSocket sample code for java.rmi.server.RMIServerSocketFactory.createServerSocket(int) definition code for java.rmi.server.RMIServerSocketFactory.createServerSocket(int) in interface RMIServerSocketFactory sample code for java.rmi.server.RMIServerSocketFactory definition code for java.rmi.server.RMIServerSocketFactory
Parameters:
port - the port number
Returns:
the server socket on the specified port
Throws:
IOException sample code for java.io.IOException definition code for java.io.IOException - if an I/O error occurs during server socket creation

equals sample code for javax.rmi.ssl.SslRMIServerSocketFactory.equals(java.lang.Object) definition code for javax.rmi.ssl.SslRMIServerSocketFactory.equals(java.lang.Object)

public boolean equals(Object sample code for java.lang.Object definition code for java.lang.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 as hashCode() sample code for javax.rmi.ssl.SslRMIServerSocketFactory.hashCode() definition code for javax.rmi.ssl.SslRMIServerSocketFactory.hashCode() ) if it adds instance state that affects equality.

Overrides:
equals sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) in class Object sample code for java.lang.Object definition code for java.lang.Object
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() sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() , Hashtable sample code for java.util.Hashtable definition code for java.util.Hashtable

hashCode sample code for javax.rmi.ssl.SslRMIServerSocketFactory.hashCode() definition code for javax.rmi.ssl.SslRMIServerSocketFactory.hashCode()

public int hashCode()

Returns a hash code value for this SslRMIServerSocketFactory.

Overrides:
hashCode sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() in class Object sample code for java.lang.Object definition code for java.lang.Object
Returns:
a hash code value for this SslRMIServerSocketFactory.
See Also:
Object.equals(java.lang.Object) sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) , Hashtable sample code for java.util.Hashtable definition code for java.util.Hashtable