| |
|
| com.uwyn.rife.authentication.RememberManager
All known Subclasses: com.uwyn.rife.authentication.remembermanagers.DatabaseRemember, com.uwyn.rife.authentication.remembermanagers.CustomRememberManager, com.uwyn.rife.authentication.remembermanagers.PurgingRememberManager,
RememberManager | public interface RememberManager (Code) | | 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.
author: Geert Bevin (gbevin[remove] at uwyn dot com) version: $Revision: 3643 $ See Also: com.uwyn.rife.authentication.credentials.RememberMe since: 1.0 |
Method Summary | |
public String | createRememberId(long userId, String hostIp) Starts a new session.
Parameters: userId - The ID that uniquely identifies the user that has to beremembered. Parameters: hostIp - The ip address of the host from which the user accessesthe application. | public void | eraseAllRememberIds() Removes all available remember ID. | public boolean | eraseRememberId(String rememberId) Removes one particular remember ID. | public boolean | eraseUserRememberIds(long userId) Removes all remember IDs for a particular user. | public long | getRememberDuration() Obtains the maximum time that a remember ID can be used before it
becomes invalid. | public long | getRememberedUserId(String rememberId) Retrieves the user ID that corresponds to a certain remember ID.
Parameters: rememberId - The remember ID that maps to the user ID. | public void | purgeRememberIds() Removes all remember IDs that are expired. | public void | setRememberDuration(long milliseconds) Sets the maximum time that a remember ID can be used before it becomes
invalid. |
createRememberId | public String createRememberId(long userId, String hostIp) throws RememberManagerException(Code) | | Starts a new session.
Parameters: userId - The ID that uniquely identifies the user that has to beremembered. Parameters: hostIp - The ip address of the host from which the user accessesthe application. A String that uniquely identifies the remembereduser ID. exception: RememberManagerException - An undefined number of exceptionalcases or error situations can occur when a remember ID is created. Theyare all indicated by throwing an instance of RememberManagerException . It's up to the implementationsof this interface to give more specific meanings to these exceptions. since: 1.0 |
eraseAllRememberIds | public void eraseAllRememberIds() throws RememberManagerException(Code) | | Removes all available remember ID. This makes all existing remember IDs
instantly invalid and unusable for all users.
exception: RememberManagerException - An undefined number of exceptionalcases or error situations can occur when a remember ID is erased. Theyare all indicated by throwing an instance of RememberManagerException . It's up to the implementationsof this interface to give more specific meanings to these exceptions. since: 1.0 |
eraseRememberId | public boolean eraseRememberId(String rememberId) throws RememberManagerException(Code) | | Removes one particular remember ID. This makes it instantly invalid.
Parameters: rememberId - The remember ID that needs to be erased. true if the ID was successfully erased; or false if this was not possible. exception: RememberManagerException - An undefined number of exceptionalcases or error situations can occur when a remember ID is erased. Theyare all indicated by throwing an instance of RememberManagerException . It's up to the implementationsof this interface to give more specific meanings to these exceptions. since: 1.0 |
eraseUserRememberIds | public boolean eraseUserRememberIds(long userId) throws RememberManagerException(Code) | | Removes all remember IDs for a particular user. This makes all issued
remember IDs instantly invalid.
Parameters: userId - The id that uniquely identifies the user whose rememberIDs are to be erased. true if the IDs were successfully erased; or false if this was not possible exception: RememberManagerException - An undefined number of exceptionalcases or error situations can occur when a remember ID is erased. Theyare all indicated by throwing an instance of RememberManagerException . It's up to the implementationsof this interface to give more specific meanings to these exceptions. since: 1.0 |
getRememberDuration | public long getRememberDuration()(Code) | | Obtains the maximum time that a remember ID can be used before it
becomes invalid.
The maximum lifetime in milliseconds. since: 1.0 |
getRememberedUserId | public long getRememberedUserId(String rememberId) throws RememberManagerException(Code) | | Retrieves the user ID that corresponds to a certain remember ID.
Parameters: rememberId - The remember ID that maps to the user ID. the ID of the user that corresponds to the provided rememberID; or -1 if no user ID corresponds to the provided rememberID. exception: RememberManagerException - An undefined number of exceptionalcases or error situations can occur when a user ID is retrieved. Theyare all indicated by throwing an instance of RememberManagerException . It's up to the implementationsof this interface to give more specific meanings to these exceptions. since: 1.0 |
purgeRememberIds | public void purgeRememberIds() throws RememberManagerException(Code) | | Removes all remember IDs that are expired. This means that all remember
IDs where the lifetime has been exceeded, will be removed.
exception: RememberManagerException - An undefined number of exceptionalcases or error situations can occur when a remember ID is purged. Theyare all indicated by throwing an instance of RememberManagerException . It's up to the implementationsof this interface to give more specific meanings to these exceptions. since: 1.0 |
setRememberDuration | public void setRememberDuration(long milliseconds)(Code) | | Sets the maximum time that a remember ID can be used before it becomes
invalid.
Parameters: milliseconds - The lifetime in milliseconds. since: 1.0 |
|
|
|