|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface RememberManager
This interface defines the methods that classes with
RememberManager functionalities have to implement.
A RememberManager is reponsible for coupling a user ID to
an expiring remember ID. The remember ID is typically stored in a cookie in
the browser and expires after a certain duration. An authentication element
that uses a RememberManager, should erase the remember ID
after using it once, create a new one immediately and send it to the
client. This ensures that each remember ID can only be used once.
RememberMe| Method Summary | |
|---|---|
String |
createRememberId(long userId,
String hostIp)
Starts a new session. |
void |
eraseAllRememberIds()
Removes all available remember ID. |
boolean |
eraseRememberId(String rememberId)
Removes one particular remember ID. |
boolean |
eraseUserRememberIds(long userId)
Removes all remember IDs for a particular user. |
long |
getRememberDuration()
Obtains the maximum time that a remember ID can be used before it becomes invalid. |
long |
getRememberedUserId(String rememberId)
Retrieves the user ID that corresponds to a certain remember ID. |
void |
purgeRememberIds()
Removes all remember IDs that are expired. |
void |
setRememberDuration(long milliseconds)
Sets the maximum time that a remember ID can be used before it becomes invalid. |
| Method Detail |
|---|
long getRememberDuration()
void setRememberDuration(long milliseconds)
milliseconds - The lifetime in milliseconds.
String createRememberId(long userId,
String hostIp)
throws RememberManagerException
userId - The ID that uniquely identifies the user that has to be
remembered.hostIp - The ip address of the host from which the user accesses
the application.
String that uniquely identifies the remembered
user ID.
RememberManagerException - An undefined number of exceptional
cases or error situations can occur when a remember ID is created. They
are all indicated by throwing an instance of
RememberManagerException. It's up to the implementations
of this interface to give more specific meanings to these exceptions.
boolean eraseRememberId(String rememberId)
throws RememberManagerException
rememberId - The remember ID that needs to be erased.
true if the ID was successfully erased; or
false if this was not possible.
RememberManagerException - An undefined number of exceptional
cases or error situations can occur when a remember ID is erased. They
are all indicated by throwing an instance of
RememberManagerException. It's up to the implementations
of this interface to give more specific meanings to these exceptions.
boolean eraseUserRememberIds(long userId)
throws RememberManagerException
userId - The id that uniquely identifies the user whose remember
IDs are to be erased.
true if the IDs were successfully erased; or
false if this was not possible
RememberManagerException - An undefined number of exceptional
cases or error situations can occur when a remember ID is erased. They
are all indicated by throwing an instance of
RememberManagerException. It's up to the implementations
of this interface to give more specific meanings to these exceptions.
void eraseAllRememberIds()
throws RememberManagerException
RememberManagerException - An undefined number of exceptional
cases or error situations can occur when a remember ID is erased. They
are all indicated by throwing an instance of
RememberManagerException. It's up to the implementations
of this interface to give more specific meanings to these exceptions.
long getRememberedUserId(String rememberId)
throws RememberManagerException
rememberId - The remember ID that maps to the user ID.
-1 if no user ID corresponds to the provided remember
ID.
RememberManagerException - An undefined number of exceptional
cases or error situations can occur when a user ID is retrieved. They
are all indicated by throwing an instance of
RememberManagerException. It's up to the implementations
of this interface to give more specific meanings to these exceptions.
void purgeRememberIds()
throws RememberManagerException
RememberManagerException - An undefined number of exceptional
cases or error situations can occur when a remember ID is purged. They
are all indicated by throwing an instance of
RememberManagerException. It's up to the implementations
of this interface to give more specific meanings to these exceptions.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||