Class BasicAuthentication
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.flow.rest.dex.clientauthentication.AbstractClientAuthentication
-
- adams.flow.rest.dex.clientauthentication.BasicAuthentication
-
- All Implemented Interfaces:
adams.core.ClassCrossReference
,adams.core.CrossReference
,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.SizeOfHandler
,adams.flow.core.FlowContextHandler
,Serializable
public class BasicAuthentication extends AbstractClientAuthentication implements adams.core.ClassCrossReference, adams.core.PasswordPrompter
Generates simple 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 password to use.protected adams.core.base.BasePassword
m_Password
the password.protected boolean
m_PromptForPassword
whether to prompt the user for a password if none provided.protected String
m_User
the user.-
Fields inherited from class adams.flow.rest.dex.clientauthentication.AbstractClientAuthentication
m_FlowContext
-
-
Constructor Summary
Constructors Constructor Description BasicAuthentication()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
defineOptions()
Adds options to the internal list of options.protected adams.core.base.BaseKeyValuePair[]
doGenerate(adams.core.MessageCollection errors)
Generates the authentication parameters for sending to the server.protected boolean
doInteract()
Performs the interaction with the user.Class[]
getClassCrossReferences()
Returns the cross-referenced classes.adams.core.base.BasePassword
getPassword()
Returns the password.boolean
getPromptForPassword()
Returns whether to prompt for a password if none currently provided.String
getUser()
Returns the user.String
globalInfo()
Returns a string describing the object.String
passwordTipText()
Returns the tip text for this property.String
promptForPasswordTipText()
Returns the tip text for this property.protected boolean
requiresFlowContext()
Whether the scheme actually requires a flow context.protected void
reset()
Resets the scheme.void
setPassword(adams.core.base.BasePassword value)
Sets the password.void
setPromptForPassword(boolean value)
Sets whether to prompt for a password if none currently provided.void
setUser(String value)
Sets the user.String
userTipText()
Returns the tip text for this property.-
Methods inherited from class adams.flow.rest.dex.clientauthentication.AbstractClientAuthentication
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_User
protected String m_User
the user.
-
m_Password
protected adams.core.base.BasePassword m_Password
the password.
-
m_ActualPassword
protected adams.core.base.BasePassword m_ActualPassword
the actual password to use.
-
m_PromptForPassword
protected boolean m_PromptForPassword
whether to prompt the user for a password if none provided.
-
-
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
-
setUser
public void setUser(String value)
Sets the user.- Parameters:
value
- the user
-
getUser
public String getUser()
Returns the 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 password.- Specified by:
setPassword
in interfaceadams.core.PasswordSupporter
- Parameters:
value
- the password
-
getPassword
public adams.core.base.BasePassword getPassword()
Returns the 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.
-
getClassCrossReferences
public Class[] getClassCrossReferences()
Returns the cross-referenced classes.- Specified by:
getClassCrossReferences
in interfaceadams.core.ClassCrossReference
- Returns:
- the classes
-
requiresFlowContext
protected boolean requiresFlowContext()
Whether the scheme actually requires a flow context.- Specified by:
requiresFlowContext
in classAbstractClientAuthentication
- Returns:
- true if required
-
doInteract
protected boolean doInteract()
Performs the interaction with the user.- Returns:
- true if successfully interacted
-
doGenerate
protected adams.core.base.BaseKeyValuePair[] doGenerate(adams.core.MessageCollection errors)
Generates the authentication parameters for sending to the server.- Specified by:
doGenerate
in classAbstractClientAuthentication
- Parameters:
errors
- for collecting errors- Returns:
- the generated key-value pairs, null in case of an error
-
-