jacquard 1.12.0 by The Web Engineering Factory and Toolworks

uk.co.weft.dbutil
Interface Authenticator

All Known Implementing Classes:
JDBCAuthenticator

public interface Authenticator

an interface describing an agent which can authenticate a context

Version:
$Revision: 1.4.4.1 $ This revision: $Author: simon $
Author:
Simon Brooke

Field Summary
static int BADDATA
          return value indicating that the data (e.g.
static int ISVALID
          return value indicating that the context is valid
static int NODATA
          return value indicating that there wasn't enough data to determine whether the context was valid (e.g.
static int TOKEN_FEATURE_ACCEPT_DEFAULT
          Token features: bitwise andable values which allow information about the features of a token to be combined into a single return value.
static int TOKEN_FEATURE_OPTIONAL
          Token features: bitwise andable values which allow information about the features of a token to be combined into a single return value.
static int TOKEN_FEATURE_SECRET
          Token features: bitwise andable values which allow information about the features of a token to be combined into a single return value.
static int UNKNOWN
          return value indicating failure to determine authenticity (e.g.
 
Method Summary
 int getFeatures(java.lang.String token)
          what features does this authentication token have?
 java.lang.String getHelp(java.lang.String token)
          what is the appropriate help string for this token?
 java.lang.String getPrompt(java.lang.String token)
          what is the appropriate user prompt for this token?
 int getSize(java.lang.String token)
          what is the maximum acceptable length of the value of this token?
 void init(Context config)
          initialise me with information from this context
 java.lang.String[] interestingTokens()
          what tokens am I interested in in a context?
 int isAuthentic(Context context)
          Is the information in this context authentic? Return true if happy, false if unhappy for any reason
 boolean isSecret(java.lang.String token)
          Deprecated. use getFeatures( token) instead
 

Field Detail

ISVALID

public static final int ISVALID
return value indicating that the context is valid

See Also:
Constant Field Values

NODATA

public static final int NODATA
return value indicating that there wasn't enough data to determine whether the context was valid (e.g. no username, no password)

See Also:
Constant Field Values

BADDATA

public static final int BADDATA
return value indicating that the data (e.g. username, password) were invalid

See Also:
Constant Field Values

UNKNOWN

public static final int UNKNOWN
return value indicating failure to determine authenticity (e.g. because the backend wasn't available

See Also:
Constant Field Values

TOKEN_FEATURE_SECRET

public static final int TOKEN_FEATURE_SECRET
Token features: bitwise andable values which allow information about the features of a token to be combined into a single return value. Yes, not a very Java way of doing things. This token feature means that a password type non-echoing widget should be used to collect this value

See Also:
Constant Field Values

TOKEN_FEATURE_OPTIONAL

public static final int TOKEN_FEATURE_OPTIONAL
Token features: bitwise andable values which allow information about the features of a token to be combined into a single return value. Yes, not a very Java way of doing things. This token feature means that no value need be returned for this token. Note, however, that in an authentication context if there's more than on 'optional' token then probably a value will be needed for at least one of them

See Also:
Constant Field Values

TOKEN_FEATURE_ACCEPT_DEFAULT

public static final int TOKEN_FEATURE_ACCEPT_DEFAULT
Token features: bitwise andable values which allow information about the features of a token to be combined into a single return value. Yes, not a very Java way of doing things. This token feature means that if a value is already available for this token the user should not be able to change it

See Also:
Constant Field Values
Method Detail

init

public void init(Context config)
initialise me with information from this context

Parameters:
config - a context within which I may find my configuration

isAuthentic

public int isAuthentic(Context context)
Is the information in this context authentic? Return true if happy, false if unhappy for any reason

Returns:
ISVALID if all OK; NODATA if data required to authenticate is missing; BADDATA if the data supplied was invalid; and UNKNOWN if authenticity could not be determined

interestingTokens

public java.lang.String[] interestingTokens()
what tokens am I interested in in a context?

Returns:
as an array of strings the tokens which I consider interesting in a context. These are, obviously, the tokens whose values I will use to try to authenticate the context.

isSecret

public boolean isSecret(java.lang.String token)
Deprecated. use getFeatures( token) instead

is the value of this token a secret (e.g., a password or passphrase).

Parameters:
token - the token, should be one of my interesting tokens
Returns:
true if the value of the token is a secret, false otherwise.
See Also:
getFeatures(String)

getFeatures

public int getFeatures(java.lang.String token)
what features does this authentication token have?

Parameters:
token -
Returns:
an integer which is a bitwise and of all the token features which are relevant to this token.

getPrompt

public java.lang.String getPrompt(java.lang.String token)
what is the appropriate user prompt for this token?

Parameters:
token - the token, should be one of my interesting tokens
Returns:
a suitable prompt

getSize

public int getSize(java.lang.String token)
what is the maximum acceptable length of the value of this token?

Parameters:
token - the token, should be one of my interesting tokens
Returns:
the maximum size of the value I expect

getHelp

public java.lang.String getHelp(java.lang.String token)
what is the appropriate help string for this token?

Parameters:
token - the token, should be one of my interesting tokens
Returns:
a suitable help string

jacquard 1.12.0 by The Web Engineering Factory and Toolworks