Class SSLConnectionFactory

  • All Implemented Interfaces:
    adams.core.Destroyable, adams.core.GlobalInfoSupporter, adams.core.logging.LoggingLevelHandler, adams.core.logging.LoggingSupporter, adams.core.option.OptionHandler, adams.core.QuickInfoSupporter, adams.core.SizeOfHandler, adams.flow.core.FlowContextHandler, Serializable

    public class SSLConnectionFactory
    extends AbstractConnectionFactory
    For encrypting a connection with SSL.
    Author:
    FracPete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Detail

      • m_KeyManagerKeystoreType

        protected String m_KeyManagerKeystoreType
        the keystore type (KeyManager).
      • m_KeyManagerKeystoreFile

        protected adams.core.io.PlaceholderFile m_KeyManagerKeystoreFile
        the location of the keystore (KeyManager).
      • m_KeyManagerKeystorePassphrase

        protected adams.core.base.BasePassword m_KeyManagerKeystorePassphrase
        the passphrase for the keystore file (KeyManager).
      • m_KeyManagerAlgorithm

        protected String m_KeyManagerAlgorithm
        the algorithm to use (KeyManager).
      • m_KeyManagerFactory

        protected transient KeyManagerFactory m_KeyManagerFactory
        the key manager factory in use.
      • m_TrustManagerKeystoreType

        protected String m_TrustManagerKeystoreType
        the keystore type (TrustManager).
      • m_TrustManagerKeystoreFile

        protected adams.core.io.PlaceholderFile m_TrustManagerKeystoreFile
        the location of the keystore (TrustManager).
      • m_TrustManagerKeystorePassphrase

        protected adams.core.base.BasePassword m_TrustManagerKeystorePassphrase
        the passphrase for the keystore file (TrustManager).
      • m_TrustManagerAlgorithm

        protected String m_TrustManagerAlgorithm
        the algorithm to use (TrustManager).
      • m_TrustManagerFactory

        protected transient TrustManagerFactory m_TrustManagerFactory
        the trust manager factory in use.
      • m_ActualPassphrase

        protected adams.core.base.BasePassword m_ActualPassphrase
        the actual password to use.
      • m_PromptForPassword

        protected boolean m_PromptForPassword
        whether to prompt the user for a password if none provided.
      • m_StopFlowIfCanceled

        protected boolean m_StopFlowIfCanceled
        whether to stop the flow if canceled.
      • m_CustomStopMessage

        protected String m_CustomStopMessage
        the custom stop message to use if flow gets stopped due to cancelation.
      • m_StopMode

        protected adams.flow.core.StopMode m_StopMode
        how to perform the stop.
      • m_Protocol

        protected String m_Protocol
        the protocol to use.
      • m_SSLContext

        protected transient SSLContext m_SSLContext
        the SSL context.
      • m_HostnameVerification

        protected boolean m_HostnameVerification
        whether to use hostname verification (if SSL on).
    • Constructor Detail

      • SSLConnectionFactory

        public SSLConnectionFactory()
    • Method Detail

      • globalInfo

        public String globalInfo()
        Returns a string describing the object.
        Specified by:
        globalInfo in interface adams.core.GlobalInfoSupporter
        Specified by:
        globalInfo in class adams.core.option.AbstractOptionHandler
        Returns:
        a description suitable for displaying in the gui
      • defineOptions

        public void defineOptions()
        Adds options to the internal list of options.
        Specified by:
        defineOptions in interface adams.core.option.OptionHandler
        Overrides:
        defineOptions in class adams.core.option.AbstractOptionHandler
      • reset

        protected void reset()
        Resets the scheme.
        Overrides:
        reset in class adams.core.option.AbstractOptionHandler
      • getQuickInfo

        public String getQuickInfo()
        Returns a quick info about the actor, which will be displayed in the GUI.
        Specified by:
        getQuickInfo in interface adams.core.QuickInfoSupporter
        Overrides:
        getQuickInfo in class AbstractConnectionFactory
        Returns:
        null if no info available, otherwise short string
      • setConnectionFactory

        public void setConnectionFactory​(AbstractConnectionFactory value)
        Sets the base connection factory to encrypt.
        Parameters:
        value - the factory
      • getConnectionFactory

        public AbstractConnectionFactory getConnectionFactory()
        Returns the base connection factory to encrypt.
        Returns:
        the factory
      • connectionFactoryTipText

        public String connectionFactoryTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setKeyManagerKeystoreType

        public void setKeyManagerKeystoreType​(String value)
        Sets the type of the keystore (KeyManager).
        Parameters:
        value - the type
      • getKeyManagerKeystoreType

        public String getKeyManagerKeystoreType()
        Returns the type of the keystore (KeyManager).
        Returns:
        the type
      • keyManagerKeystoreTypeTipText

        public String keyManagerKeystoreTypeTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setKeyManagerKeystoreFile

        public void setKeyManagerKeystoreFile​(adams.core.io.PlaceholderFile value)
        Sets the location of the keystore file (KeyManager).
        Parameters:
        value - the key file
      • getKeyManagerKeystoreFile

        public adams.core.io.PlaceholderFile getKeyManagerKeystoreFile()
        Returns the location of the keystore file (KeyManager).
        Returns:
        the key file
      • keyManagerKeystoreFileTipText

        public String keyManagerKeystoreFileTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setKeyManagerKeystorePassphrase

        public void setKeyManagerKeystorePassphrase​(adams.core.base.BasePassword value)
        Sets the passphrase for the keystore file, ignored if empty (KeyManager).
        Parameters:
        value - the passphrase
      • getKeyManagerKeystorePassphrase

        public adams.core.base.BasePassword getKeyManagerKeystorePassphrase()
        Returns the passphrase for the keystore file, ignored if empty (KeyManager).
        Returns:
        the passphrase
      • keyManagerKeystorePassphraseTipText

        public String keyManagerKeystorePassphraseTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setKeyManagerAlgorithm

        public void setKeyManagerAlgorithm​(String value)
        Sets the algorithm to use (KeyManager).
        Parameters:
        value - the algorithm
      • getKeyManagerAlgorithm

        public String getKeyManagerAlgorithm()
        Returns the algorithm to use (KeyManager).
        Returns:
        the algorithm
      • keyManagerAlgorithmTipText

        public String keyManagerAlgorithmTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setTrustManagerKeystoreType

        public void setTrustManagerKeystoreType​(String value)
        Sets the type of the keystore (TrustManager).
        Parameters:
        value - the type
      • getTrustManagerKeystoreType

        public String getTrustManagerKeystoreType()
        Returns the type of the keystore (TrustManager).
        Returns:
        the type
      • trustManagerKeystoreTypeTipText

        public String trustManagerKeystoreTypeTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setTrustManagerKeystoreFile

        public void setTrustManagerKeystoreFile​(adams.core.io.PlaceholderFile value)
        Sets the location of the keystore file (TrustManager).
        Parameters:
        value - the key file
      • getTrustManagerKeystoreFile

        public adams.core.io.PlaceholderFile getTrustManagerKeystoreFile()
        Returns the location of the keystore file (TrustManager).
        Returns:
        the key file
      • trustManagerKeystoreFileTipText

        public String trustManagerKeystoreFileTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setTrustManagerKeystorePassphrase

        public void setTrustManagerKeystorePassphrase​(adams.core.base.BasePassword value)
        Sets the passphrase for the keystore file, ignored if empty (TrustManager).
        Parameters:
        value - the passphrase
      • getTrustManagerKeystorePassphrase

        public adams.core.base.BasePassword getTrustManagerKeystorePassphrase()
        Returns the passphrase for the keystore file, ignored if empty (TrustManager).
        Returns:
        the passphrase
      • trustManagerKeystorePassphraseTipText

        public String trustManagerKeystorePassphraseTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setTrustManagerAlgorithm

        public void setTrustManagerAlgorithm​(String value)
        Sets the algorithm to use (TrustManager).
        Parameters:
        value - the algorithm
      • getTrustManagerAlgorithm

        public String getTrustManagerAlgorithm()
        Returns the algorithm to use (TrustManager).
        Returns:
        the algorithm
      • trustManagerAlgorithmTipText

        public String trustManagerAlgorithmTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setPromptForPassword

        public void setPromptForPassword​(boolean value)
        Sets whether to prompt for a password if none currently provided.
        Parameters:
        value - true if to prompt for a password
      • getPromptForPassword

        public boolean getPromptForPassword()
        Returns whether to prompt for a password if none currently provided.
        Returns:
        true if to prompt for a password
      • promptForPasswordTipText

        public String promptForPasswordTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setStopFlowIfCanceled

        public void setStopFlowIfCanceled​(boolean value)
        Sets whether to stop the flow if dialog canceled.
        Parameters:
        value - if true flow gets stopped if dialog canceled
      • getStopFlowIfCanceled

        public boolean getStopFlowIfCanceled()
        Returns whether to stop the flow if dialog canceled.
        Returns:
        true if the flow gets stopped if dialog canceled
      • stopFlowIfCanceledTipText

        public String stopFlowIfCanceledTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setCustomStopMessage

        public void setCustomStopMessage​(String value)
        Sets the custom message to use when stopping the flow.
        Parameters:
        value - the stop message
      • getCustomStopMessage

        public String getCustomStopMessage()
        Returns the custom message to use when stopping the flow.
        Returns:
        the stop message
      • customStopMessageTipText

        public String customStopMessageTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setStopMode

        public void setStopMode​(adams.flow.core.StopMode value)
        Sets the stop mode.
        Parameters:
        value - the mode
      • getStopMode

        public adams.flow.core.StopMode getStopMode()
        Returns the stop mode.
        Returns:
        the mode
      • stopModeTipText

        public String stopModeTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setProtocol

        public void setProtocol​(String value)
        Sets the protocol to use.
        Parameters:
        value - the protocol
      • getProtocol

        public String getProtocol()
        Returns the protocol to use.
        Returns:
        the protocol
      • protocolTipText

        public String protocolTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setHostnameVerification

        public void setHostnameVerification​(boolean value)
        Sets whether to perform hostname verification.
        Parameters:
        value - true if to verify
      • getHostnameVerification

        public boolean getHostnameVerification()
        Returns whether to perform hostname verification.
        Returns:
        true if to verify
      • hostnameVerificationTipText

        public String hostnameVerificationTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • doInteract

        public boolean doInteract()
        Performs the interaction with the user.
        Returns:
        true if successfully interacted
      • supportsHeadlessInteraction

        public boolean supportsHeadlessInteraction()
        Returns whether headless interaction is supported.
        Returns:
        true if interaction in headless environment is possible
      • doInteractHeadless

        public boolean doInteractHeadless()
        Performs the interaction with the user in a headless environment.
        Returns:
        true if successfully interacted
      • doGenerate

        protected com.rabbitmq.client.ConnectionFactory doGenerate​(adams.core.MessageCollection errors)
        Generates the connection factory object.
        Specified by:
        doGenerate in class AbstractConnectionFactory
        Parameters:
        errors - for collecting errors
        Returns:
        the factory, null in case of error