Class SSLConnectionFactory
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.core.net.rabbitmq.connection.AbstractConnectionFactory
-
- adams.core.net.rabbitmq.connection.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 Summary
Fields Modifier and Type Field Description protected adams.core.base.BasePassword
m_ActualPassphrase
the actual password to use.protected AbstractConnectionFactory
m_ConnectionFactory
the base connection factory.protected String
m_CustomStopMessage
the custom stop message to use if flow gets stopped due to cancelation.protected boolean
m_HostnameVerification
whether to use hostname verification (if SSL on).protected String
m_KeyManagerAlgorithm
the algorithm to use (KeyManager).protected KeyManagerFactory
m_KeyManagerFactory
the key manager factory in use.protected adams.core.io.PlaceholderFile
m_KeyManagerKeystoreFile
the location of the keystore (KeyManager).protected adams.core.base.BasePassword
m_KeyManagerKeystorePassphrase
the passphrase for the keystore file (KeyManager).protected String
m_KeyManagerKeystoreType
the keystore type (KeyManager).protected boolean
m_PromptForPassword
whether to prompt the user for a password if none provided.protected String
m_Protocol
the protocol to use.protected SSLContext
m_SSLContext
the SSL context.protected boolean
m_StopFlowIfCanceled
whether to stop the flow if canceled.protected adams.flow.core.StopMode
m_StopMode
how to perform the stop.protected String
m_TrustManagerAlgorithm
the algorithm to use (TrustManager).protected TrustManagerFactory
m_TrustManagerFactory
the trust manager factory in use.protected adams.core.io.PlaceholderFile
m_TrustManagerKeystoreFile
the location of the keystore (TrustManager).protected adams.core.base.BasePassword
m_TrustManagerKeystorePassphrase
the passphrase for the keystore file (TrustManager).protected String
m_TrustManagerKeystoreType
the keystore type (TrustManager).-
Fields inherited from class adams.core.net.rabbitmq.connection.AbstractConnectionFactory
m_FlowContext
-
-
Constructor Summary
Constructors Constructor Description SSLConnectionFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
connectionFactoryTipText()
Returns the tip text for this property.String
customStopMessageTipText()
Returns the tip text for this property.void
defineOptions()
Adds options to the internal list of options.protected com.rabbitmq.client.ConnectionFactory
doGenerate(adams.core.MessageCollection errors)
Generates the connection factory object.boolean
doInteract()
Performs the interaction with the user.boolean
doInteractHeadless()
Performs the interaction with the user in a headless environment.AbstractConnectionFactory
getConnectionFactory()
Returns the base connection factory to encrypt.String
getCustomStopMessage()
Returns the custom message to use when stopping the flow.boolean
getHostnameVerification()
Returns whether to perform hostname verification.String
getKeyManagerAlgorithm()
Returns the algorithm to use (KeyManager).adams.core.io.PlaceholderFile
getKeyManagerKeystoreFile()
Returns the location of the keystore file (KeyManager).adams.core.base.BasePassword
getKeyManagerKeystorePassphrase()
Returns the passphrase for the keystore file, ignored if empty (KeyManager).String
getKeyManagerKeystoreType()
Returns the type of the keystore (KeyManager).boolean
getPromptForPassword()
Returns whether to prompt for a password if none currently provided.String
getProtocol()
Returns the protocol to use.String
getQuickInfo()
Returns a quick info about the actor, which will be displayed in the GUI.boolean
getStopFlowIfCanceled()
Returns whether to stop the flow if dialog canceled.adams.flow.core.StopMode
getStopMode()
Returns the stop mode.String
getTrustManagerAlgorithm()
Returns the algorithm to use (TrustManager).adams.core.io.PlaceholderFile
getTrustManagerKeystoreFile()
Returns the location of the keystore file (TrustManager).adams.core.base.BasePassword
getTrustManagerKeystorePassphrase()
Returns the passphrase for the keystore file, ignored if empty (TrustManager).String
getTrustManagerKeystoreType()
Returns the type of the keystore (TrustManager).String
globalInfo()
Returns a string describing the object.String
hostnameVerificationTipText()
Returns the tip text for this property.String
keyManagerAlgorithmTipText()
Returns the tip text for this property.String
keyManagerKeystoreFileTipText()
Returns the tip text for this property.String
keyManagerKeystorePassphraseTipText()
Returns the tip text for this property.String
keyManagerKeystoreTypeTipText()
Returns the tip text for this property.String
promptForPasswordTipText()
Returns the tip text for this property.String
protocolTipText()
Returns the tip text for this property.protected boolean
requiresFlowContext()
Returns whether a flow context is required.protected void
reset()
Resets the scheme.void
setConnectionFactory(AbstractConnectionFactory value)
Sets the base connection factory to encrypt.void
setCustomStopMessage(String value)
Sets the custom message to use when stopping the flow.void
setHostnameVerification(boolean value)
Sets whether to perform hostname verification.void
setKeyManagerAlgorithm(String value)
Sets the algorithm to use (KeyManager).void
setKeyManagerKeystoreFile(adams.core.io.PlaceholderFile value)
Sets the location of the keystore file (KeyManager).void
setKeyManagerKeystorePassphrase(adams.core.base.BasePassword value)
Sets the passphrase for the keystore file, ignored if empty (KeyManager).void
setKeyManagerKeystoreType(String value)
Sets the type of the keystore (KeyManager).void
setPromptForPassword(boolean value)
Sets whether to prompt for a password if none currently provided.void
setProtocol(String value)
Sets the protocol to use.void
setStopFlowIfCanceled(boolean value)
Sets whether to stop the flow if dialog canceled.void
setStopMode(adams.flow.core.StopMode value)
Sets the stop mode.void
setTrustManagerAlgorithm(String value)
Sets the algorithm to use (TrustManager).void
setTrustManagerKeystoreFile(adams.core.io.PlaceholderFile value)
Sets the location of the keystore file (TrustManager).void
setTrustManagerKeystorePassphrase(adams.core.base.BasePassword value)
Sets the passphrase for the keystore file, ignored if empty (TrustManager).void
setTrustManagerKeystoreType(String value)
Sets the type of the keystore (TrustManager).String
stopFlowIfCanceledTipText()
Returns the tip text for this property.String
stopModeTipText()
Returns the tip text for this property.boolean
supportsHeadlessInteraction()
Returns whether headless interaction is supported.String
trustManagerAlgorithmTipText()
Returns the tip text for this property.String
trustManagerKeystoreFileTipText()
Returns the tip text for this property.String
trustManagerKeystorePassphraseTipText()
Returns the tip text for this property.String
trustManagerKeystoreTypeTipText()
Returns the tip text for this property.-
Methods inherited from class adams.core.net.rabbitmq.connection.AbstractConnectionFactory
check, generate, getFlowContext, setFlowContext
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, initialize, loggingLevelTipText, newOptionManager, setLoggingLevel, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
-
-
-
Field Detail
-
m_ConnectionFactory
protected AbstractConnectionFactory m_ConnectionFactory
the base connection factory.
-
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).
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfo
in interfaceadams.core.GlobalInfoSupporter
- Specified by:
globalInfo
in classadams.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 interfaceadams.core.option.OptionHandler
- Overrides:
defineOptions
in classadams.core.option.AbstractOptionHandler
-
reset
protected void reset()
Resets the scheme.- Overrides:
reset
in classadams.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 interfaceadams.core.QuickInfoSupporter
- Overrides:
getQuickInfo
in classAbstractConnectionFactory
- 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.
-
requiresFlowContext
protected boolean requiresFlowContext()
Returns whether a flow context is required.- Specified by:
requiresFlowContext
in classAbstractConnectionFactory
- Returns:
- true if required
-
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 classAbstractConnectionFactory
- Parameters:
errors
- for collecting errors- Returns:
- the factory, null in case of error
-
-