jacquard 1.12.0 by The Web Engineering Factory and Toolworks

uk.co.weft.dbutil
Class JDBCAuthenticator

java.lang.Object
  extended byuk.co.weft.dbutil.JDBCAuthenticator
All Implemented Interfaces:
Authenticator

public class JDBCAuthenticator
extends java.lang.Object
implements Authenticator

an authenticator which authenticates against a JDBC data source

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

Field Summary
protected  java.lang.String[] allTokens
          tokens whose values are required to authenticate via JDBC
static int DEFAULTSIZE
          the default size of widgets I request
protected  java.lang.String[] noUrlTokens
          the above, less the db url token, for use when the db url is known
protected  boolean requestURL
          selects which of the above two token sets to use; set false only if the db url will certainly be known
 
Fields inherited from interface uk.co.weft.dbutil.Authenticator
BADDATA, ISVALID, NODATA, TOKEN_FEATURE_ACCEPT_DEFAULT, TOKEN_FEATURE_OPTIONAL, TOKEN_FEATURE_SECRET, UNKNOWN
 
Constructor Summary
JDBCAuthenticator()
           
 
Method Summary
 int getFeatures(java.lang.String token)
          return the features which apply to this token.
 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)
          DOCUMENT ME!
 int getSize(java.lang.String token)
          what is the maximum acceptable length of the value of this token?
 void init(Context config)
          is there a database url in the configuration? If so there's no need to prompt for one.
 java.lang.String[] interestingTokens()
          what tokens am I interested in in a context?
 int isAuthentic(Context context)
          Is the information in this context authentic?
 boolean isSecret(java.lang.String token)
          Deprecated.  
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULTSIZE

public static final int DEFAULTSIZE
the default size of widgets I request

See Also:
Constant Field Values

allTokens

protected java.lang.String[] allTokens
tokens whose values are required to authenticate via JDBC


noUrlTokens

protected java.lang.String[] noUrlTokens
the above, less the db url token, for use when the db url is known


requestURL

protected boolean requestURL
selects which of the above two token sets to use; set false only if the db url will certainly be known

Constructor Detail

JDBCAuthenticator

public JDBCAuthenticator()
Method Detail

init

public void init(Context config)
is there a database url in the configuration? If so there's no need to prompt for one.

Specified by:
init in interface Authenticator
Parameters:
config - a context within which I may find my configuration

isAuthentic

public int isAuthentic(Context context)
Is the information in this context authentic?

Specified by:
isAuthentic in interface Authenticator
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?

Specified by:
interestingTokens in interface Authenticator
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.  

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

Specified by:
isSecret in interface Authenticator
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:
Authenticator.getFeatures(String)

getPrompt

public java.lang.String getPrompt(java.lang.String token)
DOCUMENT ME!

Specified by:
getPrompt in interface Authenticator
Parameters:
token - DOCUMENT ME!
Returns:
DOCUMENT ME!

getSize

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

Specified by:
getSize in interface Authenticator
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?

Specified by:
getHelp in interface Authenticator
Parameters:
token - the token, should be one of my interesting tokens
Returns:
a suitable help string

getFeatures

public int getFeatures(java.lang.String token)
return the features which apply to this token.

Specified by:
getFeatures in interface Authenticator
Parameters:
token -
Returns:
an integer which is a bitwise and of all the token features which are relevant to this token.

jacquard 1.12.0 by The Web Engineering Factory and Toolworks