|
JSecurity | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface SessionManager
A SessionManager manages the creation, maintenance, and clean-up of all application
Sessions.
| Method Summary | |
|---|---|
Object |
getAttribute(Serializable sessionId,
Object key)
Returns the object bound to the specified session identified by the specified key. |
Collection<Object> |
getAttributeKeys(Serializable sessionId)
Returns the keys of all the attributes stored under the session identified by sessionId. |
InetAddress |
getHostAddress(Serializable sessionId)
Returns the IP address of the host where the session was started, if known. |
Date |
getLastAccessTime(Serializable sessionId)
Returns the time the Session identified by the specified sessionId last interacted with the system. |
Date |
getStartTimestamp(Serializable sessionId)
Returns the time the Session identified by the specified sessionId was started in the system. |
long |
getTimeout(Serializable sessionId)
Returns the time in milliseconds that the specified session may remain idle before expiring. |
boolean |
isValid(Serializable sessionId)
Returns true if the session is valid (it exists and is not stopped nor expired), false otherwise. |
Object |
removeAttribute(Serializable sessionId,
Object key)
Removes (unbinds) the object bound to this session under the specified key name. |
void |
setAttribute(Serializable sessionId,
Object key,
Object value)
Binds the specified value to the specified session uniquely identified by the specifed key name. |
void |
setTimeout(Serializable sessionId,
long maxIdleTimeInMillis)
Sets the time in milliseconds that the specified session may remain idle before expiring. |
Serializable |
start(InetAddress originatingHost)
Starts a new session within the system for the host with the specified originating IP address. |
void |
stop(Serializable sessionId)
Explicitly stops the session identified by sessionId, thereby releasing all associated resources. |
void |
touch(Serializable sessionId)
Updates the last accessed time of the session identified by sessionId. |
| Method Detail |
|---|
Serializable start(InetAddress originatingHost)
throws HostUnauthorizedException,
IllegalArgumentException
Note: see the
SessionFactory.init(InetAddress) method
about the implications of using InetAddresses in access control policies.
originatingHost - the originating host InetAddress of the external party
(user, 3rd party product, etc) that is attempting to interact with the system.
IllegalArgumentException - if the host specified is not valid.
HostUnauthorizedException - if the host specified is not allowed to start sessions.SessionFactory.start(InetAddress)Date getStartTimestamp(Serializable sessionId)
sessionId - the system identifier for the session of interest.
Session.getStartTimestamp()Date getLastAccessTime(Serializable sessionId)
sessionId - the system identifier for the session of interest
Session.getLastAccessTime(),
Session.touch()boolean isValid(Serializable sessionId)
sessionId - the id of the session to check
long getTimeout(Serializable sessionId)
throws InvalidSessionException
sessionId - the system identifier of the session of interest.
InvalidSessionException - if the session has been stopped or expired prior to calling this method.
void setTimeout(Serializable sessionId,
long maxIdleTimeInMillis)
throws InvalidSessionException
sessionId - the system identifier of the session of interest.maxIdleTimeInMillis - the time in milliseconds that the specified session may remain idle before expiring.
InvalidSessionException - if the session has been stopped or expired prior to calling this method.
void touch(Serializable sessionId)
throws InvalidSessionException
sessionId. This
can be used to explicitly ensure that a session does not time out.
sessionId - the id of the session to update.
InvalidSessionException - if the session has been stopped or expired prior to calling this method.Session.touch()InetAddress getHostAddress(Serializable sessionId)
null
sessionId - the id of the session to query.
null.init( InetAddress originatingHost )
void stop(Serializable sessionId)
throws InvalidSessionException
sessionId - the system identfier of the system to destroy.
InvalidSessionException - if the session has stopped or expired prior to calling
this method.Session.stop()Collection<Object> getAttributeKeys(Serializable sessionId)
sessionId - the system identifier of the system to access.
InvalidSessionException - if the specified session has stopped or expired prior to calling this method.Session.getAttributeKeys()
Object getAttribute(Serializable sessionId,
Object key)
throws InvalidSessionException
sessionId - the system identifier of the session of interestkey - the unique name of the object bound to the specified session
InvalidSessionException - if the specified session has stopped or expired prior to calling this method.Session.getAttribute(Object key)
void setAttribute(Serializable sessionId,
Object key,
Object value)
throws InvalidSessionException
If the value parameter is null, it has the same effect as if the
removeAttribute(Serializable sessionId, Object key) method was called.
sessionId - the system identifier of the session of interestkey - the name under which the value object will be bound in this sessionvalue - the object to bind in this session.
InvalidSessionException - if the specified session has stopped or expired prior to calling this method.Session.setAttribute(Object key, Object value)
Object removeAttribute(Serializable sessionId,
Object key)
throws InvalidSessionException
sessionId - the system identifier of the session of interestkey - the name uniquely identifying the object to remove
InvalidSessionException - if the specified session has stopped or expired prior to calling this method.Session.removeAttribute(Object key)
|
JSecurity | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||