public abstract class Authenticator extends Object implements com.withay.http.PasswordRetriever
PasswordRetriever implementation that performs
authentication.
Copyright 2006, Sans Pareil Technologies, Inc.
| Modifier and Type | Class and Description |
|---|---|
protected static class |
Authenticator.ManagerTask
A
TimerTask that is used to clear the userMap periodically. |
| Modifier and Type | Field and Description |
|---|---|
protected static Logger |
logger
The logger that is used to log errors or other messages.
|
protected User |
user
The User object that was fetched through the authentication
request.
|
protected static Map<String,User> |
userMap
|
protected String |
userName
The
username that was specified in the authentication
request. |
| Constructor and Description |
|---|
Authenticator() |
| Modifier and Type | Method and Description |
|---|---|
protected abstract User |
fetchUser()
Fetch the user object from the data store and populate the fields
of
user. |
String |
getPassword(String userName)
Implementation of the
PasswordRetriever.getPassword
method. |
User |
getUser()
Returns
user. |
String |
getUserName()
Returns
userName. |
protected void |
setUser(User user)
Set
user. |
protected void |
setUserName(String userName)
Set
userName. |
protected static final Logger logger
protected static final Map<String,User> userMap
Map used to cache userName and
User values. Users who do not exist
will be stored with a null object.protected User user
protected String userName
username that was specified in the authentication
request.public String getPassword(String userName) throws com.withay.http.PasswordRetrievalException
PasswordRetriever.getPassword
method. Find the User object corresponding to the
userName specified.getPassword in interface com.withay.http.PasswordRetrieveruserName - - The User.userName of the userpassword for the user.com.withay.http.PasswordRetrievalException - - If the userName specified
could not be found in the users table.fetchUser()protected abstract User fetchUser() throws com.withay.http.PasswordRetrievalException
user. Adds a new entry into userMap.com.withay.http.PasswordRetrievalException - If errors are encountered while
fetching the database object.public String getUserName()
userName.