|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.rhq.enterprise.server.auth.SessionManager
public final class SessionManager
This is the JON Server's own session ID generator. It is outside any container-provided session mechanism. Its sole
purpose is to provide session IDs to logged in Subjects. It will timeout those sessions regardless of any
container-provided session-timeout mechanism.
Because this is a very security-sensitive class, any public method requires the caller to
have the AllowEjbAccessPermission as any other calls to the EJB layer. This is so that the
malicious users can't trick the EJB layer into thinking that some users are logged in or log out other
users.
Also, for security reasons, this class is final so that malicious code can't subclass it and modify its behavior.
This object is a singleton.
| Method Summary | |
|---|---|
static SessionManager |
getInstance()
Return the singleton object. |
long |
getlastAccess(int sessionId)
|
org.rhq.core.domain.auth.Subject |
getOverlord()
|
org.rhq.core.domain.auth.Subject |
getSubject(int sessionId)
Returns the Subject associated with the given session id. |
void |
invalidate(int sessionId)
Invalidates the session associated with the given session ID. |
void |
invalidate(String username)
Invalidates all sessions for the given username. |
org.rhq.core.domain.auth.Subject |
put(org.rhq.core.domain.auth.Subject subject)
Associates a Subject with a new session id. |
org.rhq.core.domain.auth.Subject |
put(org.rhq.core.domain.auth.Subject subject,
long timeout)
Associates a Subject with a new session id with the given session timeout. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static SessionManager getInstance()
SessionManagerpublic org.rhq.core.domain.auth.Subject put(org.rhq.core.domain.auth.Subject subject)
Subject with a new session id. The new session will use the
default timeout.
subject -
public org.rhq.core.domain.auth.Subject put(org.rhq.core.domain.auth.Subject subject,
long timeout)
Subject with a new session id with the given session timeout.
subject - timeout - the timeout for the session, in milliseconds
public org.rhq.core.domain.auth.Subject getSubject(int sessionId)
throws SessionNotFoundException,
SessionTimeoutException
Subject associated with the given session id.
sessionId - The session id
Subject associated with the session id
SessionNotFoundException
SessionTimeoutExceptionpublic void invalidate(int sessionId)
sessionId - session id to invalidatepublic void invalidate(String username)
username - username for the sessions to be invalidatedpublic long getlastAccess(int sessionId)
public org.rhq.core.domain.auth.Subject getOverlord()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||