|
SPT Core API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sptci.auth.digest.Authenticator
public abstract class Authenticator
An abstract PasswordRetriever implementation that performs
authentication.
Copyright 2006, Sans Pareil Technologies, Inc.
| Nested Class Summary | |
|---|---|
protected static class |
Authenticator.ManagerTask
A TimerTask that is used to clear the userMap periodically. |
| Field Summary | |
|---|---|
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
A Map used to cache userName and
User values. |
protected String |
userName
The username that was specified in the authentication
request. |
| Constructor Summary | |
|---|---|
Authenticator()
|
|
| Method Summary | |
|---|---|
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
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.
| Constructor Detail |
|---|
public Authenticator()
| Method Detail |
|---|
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 user
password 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 User getUser()
user.
protected void setUser(User user)
user.
user - The value to set.public String getUserName()
userName.
protected void setUserName(String userName)
userName.
userName - The value to set.
|
SPT Core API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||