Class BasicAuthConnectionFactory
- 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.BasicAuthConnectionFactory
-
- All Implemented Interfaces:
adams.core.Destroyable
,adams.core.GlobalInfoSupporter
,adams.core.logging.LoggingLevelHandler
,adams.core.logging.LoggingSupporter
,adams.core.option.OptionHandler
,adams.core.PasswordPrompter
,adams.core.PasswordSupporter
,adams.core.QuickInfoSupporter
,adams.core.SizeOfHandler
,adams.flow.core.FlowContextHandler
,Serializable
public class BasicAuthConnectionFactory extends AbstractConnectionFactory implements adams.core.PasswordPrompter
Performs user/password authentication.- 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_ActualPassword
the actual SMTP password to use.protected String
m_CustomStopMessage
the custom stop message to use if flow gets stopped due to cancelation.protected String
m_Host
the host.protected adams.core.base.BasePassword
m_Password
database password.protected int
m_Port
the port.protected boolean
m_PromptForPassword
whether to prompt the user for a password if none provided.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_User
database username.protected String
m_VirtualHost
the virtual host.-
Fields inherited from class adams.core.net.rabbitmq.connection.AbstractConnectionFactory
m_FlowContext
-
-
Constructor Summary
Constructors Constructor Description BasicAuthConnectionFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected String
check()
Hook method for performing checks.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.String
getCustomStopMessage()
Returns the custom message to use when stopping the flow.String
getHost()
Returns the host to connect to.adams.core.base.BasePassword
getPassword()
Returns the database password.int
getPort()
Returns the port to connect to.boolean
getPromptForPassword()
Returns whether to prompt for a password if none currently provided.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
getUser()
Returns the database user.String
getVirtualHost()
Returns the virtual host to use.String
globalInfo()
Returns a string describing the object.String
hostTipText()
Returns the tip text for this property.String
passwordTipText()
Returns the tip text for this property.String
portTipText()
Returns the tip text for this property.String
promptForPasswordTipText()
Returns the tip text for this property.protected boolean
requiresFlowContext()
Returns whether a flow context is required.void
setCustomStopMessage(String value)
Sets the custom message to use when stopping the flow.void
setHost(String value)
Sets the host to connect to.void
setPassword(adams.core.base.BasePassword value)
Sets the database password.void
setPort(int value)
Sets the port to connect to.void
setPromptForPassword(boolean value)
Sets whether to prompt for a password if none currently provided.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
setUser(String value)
Sets the database user.void
setVirtualHost(String value)
Sets the virtual host to use.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
userTipText()
Returns the tip text for this property.String
virtualHostTipText()
Returns the tip text for this property.-
Methods inherited from class adams.core.net.rabbitmq.connection.AbstractConnectionFactory
generate, getFlowContext, setFlowContext
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, initialize, loggingLevelTipText, newOptionManager, reset, setLoggingLevel, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
-
-
-
Field Detail
-
m_Host
protected String m_Host
the host.
-
m_Port
protected int m_Port
the port.
-
m_VirtualHost
protected String m_VirtualHost
the virtual host.
-
m_User
protected String m_User
database username.
-
m_Password
protected adams.core.base.BasePassword m_Password
database password.
-
m_ActualPassword
protected adams.core.base.BasePassword m_ActualPassword
the actual SMTP 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.
-
-
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
-
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
-
setHost
public void setHost(String value)
Sets the host to connect to.- Parameters:
value
- the host name/ip
-
getHost
public String getHost()
Returns the host to connect to.- Returns:
- the host name/ip
-
hostTipText
public String hostTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setPort
public void setPort(int value)
Sets the port to connect to.- Parameters:
value
- the port
-
getPort
public int getPort()
Returns the port to connect to.- Returns:
- the port
-
portTipText
public String portTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setVirtualHost
public void setVirtualHost(String value)
Sets the virtual host to use.- Parameters:
value
- the virtual host
-
getVirtualHost
public String getVirtualHost()
Returns the virtual host to use.- Returns:
- the virtual host
-
virtualHostTipText
public String virtualHostTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setUser
public void setUser(String value)
Sets the database user.- Parameters:
value
- the user
-
getUser
public String getUser()
Returns the database user.- Returns:
- the user
-
userTipText
public String userTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setPassword
public void setPassword(adams.core.base.BasePassword value)
Sets the database password.- Specified by:
setPassword
in interfaceadams.core.PasswordSupporter
- Parameters:
value
- the password
-
getPassword
public adams.core.base.BasePassword getPassword()
Returns the database password.- Specified by:
getPassword
in interfaceadams.core.PasswordSupporter
- Returns:
- the password
-
passwordTipText
public String passwordTipText()
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.- Specified by:
setPromptForPassword
in interfaceadams.core.PasswordPrompter
- Parameters:
value
- true if to prompt for a password
-
getPromptForPassword
public boolean getPromptForPassword()
Returns whether to prompt for a password if none currently provided.- Specified by:
getPromptForPassword
in interfaceadams.core.PasswordPrompter
- Returns:
- true if to prompt for a password
-
promptForPasswordTipText
public String promptForPasswordTipText()
Returns the tip text for this property.- Specified by:
promptForPasswordTipText
in interfaceadams.core.PasswordPrompter
- 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.
-
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
-
requiresFlowContext
protected boolean requiresFlowContext()
Returns whether a flow context is required.- Specified by:
requiresFlowContext
in classAbstractConnectionFactory
- Returns:
- true if required
-
check
protected String check()
Hook method for performing checks.- Overrides:
check
in classAbstractConnectionFactory
- Returns:
- null if successful, otherwise error message
-
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
-
-