Class ReplSessionSecurity


  • public final class ReplSessionSecurity
    extends 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 Detail

      • ReplSessionSecurity

        public ReplSessionSecurity()
                            throws ConfigException
        Create a ReplSessionSecurity instance from a provided multimaster domain configuration.
        Throws:
        ConfigException - If the supplied configuration was not valid.
      • ReplSessionSecurity

        public ReplSessionSecurity​(SortedSet<String> sslCertNicknames,
                                   SortedSet<String> sslProtocols,
                                   SortedSet<String> sslCipherSuites,
                                   boolean sslEncryption)
                            throws ConfigException
        Create a ReplSessionSecurity instance from the supplied configuration values.
        Parameters:
        sslCertNicknames - The names of the local certificates 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.
    • Method Detail

      • createClientSession

        public Session createClientSession​(Socket socket,
                                           int soTimeout)
                                    throws ConfigException,
                                           IOException
        Create a new protocol session in the client role on the provided socket.
        Parameters:
        socket - The connected socket.
        soTimeout - The socket timeout option to use for the protocol session.
        Returns:
        The new protocol session.
        Throws:
        ConfigException - If the protocol session could not be established due to a configuration problem.
        IOException - If the protocol session could not be established for some other reason.
      • createServerSession

        public Session createServerSession​(Socket socket,
                                           int soTimeout)
                                    throws ConfigException,
                                           IOException
        Create a new protocol session in the server role on the provided socket.
        Parameters:
        socket - The connected socket.
        soTimeout - The socket timeout option to use for the protocol session.
        Returns:
        The new protocol session.
        Throws:
        ConfigException - If the protocol session could not be established due to a configuration problem.
        IOException - If the protocol session could not be established for some other reason.
      • isSslEncryption

        public boolean isSslEncryption()
        Determine whether sessions to a given replication server should be encrypted.
        Returns:
        true if sessions to the given replication server should be encrypted, or false if they should not be encrypted.