org.opends.server.replication.protocol
Class ReplSessionSecurity

java.lang.Object
  extended by org.opends.server.replication.protocol.ReplSessionSecurity

public class ReplSessionSecurity
extends java.lang.Object

This class represents the security configuration for replication protocol sessions. It contains all the configuration required to use SSL, and it determines whether encryption should be enabled for a session to a given replication server.


Constructor Summary
ReplSessionSecurity(ReplicationDomainCfg multimasterDomainCfg)
          Create a ReplSessionSecurity instance from a provided multimaster domain configuration.
ReplSessionSecurity(ReplicationServerCfg replServerCfg)
          Create a ReplSessionSecurity instance from a provided replication server configuration.
ReplSessionSecurity(java.lang.String sslCertNickname, java.util.SortedSet<java.lang.String> sslProtocols, java.util.SortedSet<java.lang.String> sslCipherSuites, boolean sslEncryption)
          Create a ReplSessionSecurity instance from the supplied configuration values.
 
Method Summary
 ProtocolSession createClientSession(java.lang.String serverURL, java.net.Socket socket)
          Create a new protocol session in the client role on the provided socket.
 ProtocolSession createServerSession(java.net.Socket socket)
          Create a new protocol session in the server role on the provided socket.
 boolean isSslEncryption(java.lang.String serverURL)
          Determine whether sessions to a given replication server should be encrypted.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReplSessionSecurity

public ReplSessionSecurity(java.lang.String sslCertNickname,
                           java.util.SortedSet<java.lang.String> sslProtocols,
                           java.util.SortedSet<java.lang.String> sslCipherSuites,
                           boolean sslEncryption)
                    throws ConfigException
Create a ReplSessionSecurity instance from the supplied configuration values.

Parameters:
sslCertNickname - The name of the local certificate to use, or null if none is specified.
sslProtocols - The protocols that should be enabled, or null if the default protocols should be used.
sslCipherSuites - The cipher suites that should be enabled, or null if the default cipher suites should be used.
sslEncryption - Whether replication sessions use SSL encryption.
Throws:
ConfigException - If the supplied configuration was not valid.

ReplSessionSecurity

public ReplSessionSecurity(ReplicationServerCfg replServerCfg)
                    throws ConfigException
Create a ReplSessionSecurity instance from a provided replication server configuration.

Parameters:
replServerCfg - The replication server configuration.
Throws:
ConfigException - If the supplied configuration was not valid.

ReplSessionSecurity

public ReplSessionSecurity(ReplicationDomainCfg multimasterDomainCfg)
                    throws ConfigException
Create a ReplSessionSecurity instance from a provided multimaster domain configuration.

Parameters:
multimasterDomainCfg - The multimaster domain configuration.
Throws:
ConfigException - If the supplied configuration was not valid.
Method Detail

isSslEncryption

public boolean isSslEncryption(java.lang.String serverURL)
Determine whether sessions to a given replication server should be encrypted.

Parameters:
serverURL - The replication server URL.
Returns:
true if sessions to the given replication server should be encrypted, or false if they should not be encrypted.

createClientSession

public ProtocolSession createClientSession(java.lang.String serverURL,
                                           java.net.Socket socket)
                                    throws ConfigException,
                                           java.io.IOException
Create a new protocol session in the client role on the provided socket.

Parameters:
serverURL - The remote replication server to which the socket is connected.
socket - The connected socket.
Returns:
The new protocol session.
Throws:
ConfigException - If the protocol session could not be established due to a configuration problem.
java.io.IOException - If the protocol session could not be established for some other reason.

createServerSession

public ProtocolSession createServerSession(java.net.Socket socket)
                                    throws ConfigException,
                                           java.io.IOException
Create a new protocol session in the server role on the provided socket.

Parameters:
socket - The connected socket.
Returns:
The new protocol session.
Throws:
ConfigException - If the protocol session could not be established due to a configuration problem.
java.io.IOException - If the protocol session could not be established for some other reason.