|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.uwyn.rife.authentication.sessionmanagers.MemorySessions
public class MemorySessions
| Method Summary | |
|---|---|
boolean |
continueSession(String authId)
Continues an already active session. |
long |
countSessions()
Counts the number of active sessions. |
void |
eraseAllSessions()
Removes all available sessions. |
boolean |
eraseSession(String authId)
Removes all traces of an authentication session. |
boolean |
eraseUserSessions(long userId)
Removes all traces of all authentication sessions for a particular user. |
boolean |
getRestrictHostIp()
Obtains the restriction policy of the authentication ID with regards to the user's host IP. |
MemorySession |
getSession(String authId)
|
long |
getSessionDuration()
Obtains the maximum time that a user can stay inactive before an active session becomes invalid. |
long |
getSessionUserId(String authId)
Retrieves the id of a user that has access to a particular session. |
boolean |
isSessionValid(String authId,
String hostIp)
Verifies if a session is valid and still active. |
boolean |
listSessions(ListSessions processor)
Lists the active sessions. |
void |
purgeSessions()
Removes all sessions that are inactive. |
void |
setRestrictHostIp(boolean flags)
Sets the restriction policy of the authentication ID with regards to the user's host IP. |
void |
setSessionDuration(long milliseconds)
Sets the maximum time that a user can stay inactive before an active session becomes invalid. |
String |
startSession(long userId,
String hostIp,
boolean remembered)
Starts a new session. |
boolean |
wasRemembered(String authId)
Checks if a session was previously automatically created from remembered data. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public long getSessionDuration()
SessionManager
getSessionDuration in interface SessionManagerpublic void setSessionDuration(long milliseconds)
SessionManager
setSessionDuration in interface SessionManagermilliseconds - The maximum time of inactivity in milliseconds.public boolean getRestrictHostIp()
SessionManagerThe default is false, or no restriction.
getRestrictHostIp in interface SessionManagertrue if the authentication is restricted to one host IP; or
false if the authentication ID can be used with any host IP
public void setRestrictHostIp(boolean flags)
SessionManagerThe default is false, or no restriction.
setRestrictHostIp in interface SessionManagerflags - true to activate the host IP restriction; or
false otherwise
public void purgeSessions()
SessionManager
purgeSessions in interface SessionManager
public String startSession(long userId,
String hostIp,
boolean remembered)
throws SessionManagerException
SessionManager
startSession in interface SessionManageruserId - The id that uniquely identifies the user that is allowed
to use this session.hostIp - The ip address of the host from which the user accesses
the application.remembered - Indicates whether the session is started through
remember me or from scratch.
String that uniquely identifies the
authentication session that was just started.
SessionManagerException - An undefined number of exceptional
cases or error situations can occur when a session is started. They are
all indicated by throwing an instance of
SessionManagerException. It's up to the implementations of
this interface to give more specific meanings to these exceptions.
public boolean isSessionValid(String authId,
String hostIp)
throws SessionManagerException
SessionManager
isSessionValid in interface SessionManagerauthId - The unique id of the authentication session that needs to
be verified.hostIp - The ip address of the host from which the user accesses
the application.
true if a valid active session was found; or
false if this was not possible.
SessionManagerException - An undefined number of exceptional
cases or error situations can occur when a session is verified. They
are all indicated by throwing an instance of
SessionManagerException. It's up to the implementations of
this interface to give more specific meanings to these exceptions.
public long getSessionUserId(String authId)
throws SessionManagerException
SessionManager
getSessionUserId in interface SessionManagerauthId - The unique id of the authentication session for which the
user needs to be looked up.
>= 0 that corresponds to the user id
that has access to the session; or
-1 if the session couldn't be found.
SessionManagerException - An undefined number of exceptional
cases or error situations can occur when user id of a session is
retrieved. They are all indicated by throwing an instance of
SessionManagerException. It's up to the implementations of
this interface to give more specific meanings to these exceptions.
public boolean continueSession(String authId)
throws SessionManagerException
SessionManager
continueSession in interface SessionManagerauthId - The unique id of the authentication session that needs to
be continued.
true if the session was successfully continued; or
false if this was not possible (ie. the session
couldn't be found).
SessionManagerException - An undefined number of exceptional
cases or error situations can occur when a session is continued. They
are all indicated by throwing an instance of
SessionManagerException. It's up to the implementations of
this interface to give more specific meanings to these exceptions.
public boolean eraseSession(String authId)
throws SessionManagerException
SessionManager
eraseSession in interface SessionManagerauthId - The unique id of the authentication session that needs to
be erased.
true if the session was successfully erased; or
false if this was not possible (ie. the session
couldn't be found).
SessionManagerException - An undefined number of exceptional
cases or error situations can occur when a session is erased. They are
all indicated by throwing an instance of
SessionManagerException. It's up to the implementations of
this interface to give more specific meanings to these exceptions.
public boolean wasRemembered(String authId)
throws SessionManagerException
SessionManager
wasRemembered in interface SessionManagerauthId - The unique id of the authentication session that needs to
be erased.
true if the session was created automatically from
remembered data; or
false if it was created from full credentials or if the
session couldn't be found.
SessionManagerException - An undefined number of exceptional
cases or error situations can occur when a session is erased. They are
all indicated by throwing an instance of
SessionManagerException. It's up to the implementations of
this interface to give more specific meanings to these exceptions.
public boolean eraseUserSessions(long userId)
throws SessionManagerException
SessionManager
eraseUserSessions in interface SessionManageruserId - The id that uniquely identifies the user whose sessions
are to be erased.
true if the sessions were successfully erased; or
false if this was not possible (ie. no sessions
couldn't be found).
SessionManagerException - An undefined number of exceptional
cases or error situations can occur when a session is erased. They are
all indicated by throwing an instance of
SessionManagerException. It's up to the implementations of
this interface to give more specific meanings to these exceptions.
public void eraseAllSessions()
throws SessionManagerException
SessionManager
eraseAllSessions in interface SessionManagerSessionManagerException - An undefined number of exceptional
cases or error situations can occur when a session is erased. They are
all indicated by throwing an instance of
SessionManagerException. It's up to the implementations of
this interface to give more specific meanings to these exceptions.public MemorySession getSession(String authId)
public long countSessions()
SessionManager
countSessions in interface SessionManagerpublic boolean listSessions(ListSessions processor)
SessionManager
listSessions in interface SessionManagerprocessor - The row processor that will be used to list the active
sessions.
true if active sessions were found; or
false if no session was active.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||