Class 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 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.
    • Constructor Detail

      • BasicAuthConnectionFactory

        public BasicAuthConnectionFactory()
    • 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
      • 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
      • 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 interface adams.core.PasswordSupporter
        Parameters:
        value - the password
      • getPassword

        public adams.core.base.BasePassword getPassword()
        Returns the database password.
        Specified by:
        getPassword in interface adams.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 interface adams.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 interface adams.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 interface adams.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
      • 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