|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.metamatrix.platform.service.controller.AbstractService
com.metamatrix.platform.security.session.service.SessionServiceImpl
public class SessionServiceImpl
This class serves as the primary implementation of the Session Service.
Field Summary |
---|
Fields inherited from interface com.metamatrix.platform.security.api.service.SessionServiceInterface |
---|
NAME |
Fields inherited from interface com.metamatrix.platform.service.api.ServiceInterface |
---|
WAIT_TO_DIE_TIME |
Constructor Summary | |
---|---|
SessionServiceImpl()
|
Method Summary | |
---|---|
protected void |
closeService()
Close the service to new work if applicable. |
void |
closeSession(MetaMatrixSessionID sessionID)
Closes the specified session. |
MetaMatrixSessionInfo |
createSession(java.lang.String userName,
Credentials credentials,
java.io.Serializable trustedToken,
java.lang.String applicationName,
java.util.Properties properties)
Create a session for the given user authenticating against the given Credentials . |
java.util.Collection<MetaMatrixSessionInfo> |
getActiveSessions()
Get the collection of active user sessions on the system. |
int |
getActiveSessionsCount()
Get the number of active user sessions on the system. |
MetaMatrixPrincipal |
getPrincipal(MetaMatrixSessionID sessionID)
Returns a MetaMatrixPrincipal object describing the owner (user) of the indicated session. |
java.util.Collection<MetaMatrixSessionInfo> |
getSessionsLoggedInToVDB(java.lang.String VDBName,
java.lang.String VDBVersion)
Get all MetaMatrixSessionID s that are in the ACTIVE state
and currently logged in to a VDB. |
protected void |
initService(java.util.Properties env)
Perform initialization and commence processing. |
protected void |
killService()
Terminate all processing and reclaim resources. |
void |
pingServer(MetaMatrixSessionID sessionID)
Periodically called by the client to indicate the client is still alive. |
void |
setIdGenerator(DBIDController idGenerator)
|
boolean |
terminateSession(MetaMatrixSessionID terminatedSessionID,
MetaMatrixSessionID adminSessionID)
Terminates the specified session. |
MetaMatrixSessionInfo |
validateSession(MetaMatrixSessionID sessionID)
This method is intended to verify that the session is valid, and, if need be, set the session in an active state, ready to be used. |
protected void |
waitForServiceToClear()
Wait until the service has completed all outstanding work. |
Methods inherited from class com.metamatrix.platform.service.controller.AbstractService |
---|
checkState, die, dieNow, getConnectionPoolStats, getCurrentState, getHostname, getID, getInitException, getInstanceName, getProcessName, getProperties, getQueueStatistics, getQueueStatistics, getResourceName, getServiceData, getServiceName, getServiceType, getStartTime, getStateChangeTime, init, isAlive, isClosed, isInitialized, isOpen, processEvent, registerForEvents, setInitException, unregisterForEvents, updateState |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.metamatrix.platform.service.api.ServiceInterface |
---|
checkState, die, dieNow, getConnectionPoolStats, getCurrentState, getHostname, getID, getInitException, getProcessName, getProperties, getQueueStatistics, getQueueStatistics, getServiceData, getServiceType, getStartTime, getStateChangeTime, init, isAlive, setInitException, updateState |
Constructor Detail |
---|
public SessionServiceImpl()
Method Detail |
---|
protected void initService(java.util.Properties env) throws java.lang.Exception
initService
in class AbstractService
java.lang.Exception
protected void closeService()
closeService
in class AbstractService
protected void waitForServiceToClear() throws java.lang.Exception
waitForServiceToClear
in class AbstractService
java.lang.Exception
protected void killService()
killService
in class AbstractService
public void closeSession(MetaMatrixSessionID sessionID) throws InvalidSessionException, SessionServiceException
SessionServiceInterface
closeSession
in interface SessionServiceInterface
sessionID
- The MetaMatrixSessionID identifying user's session
to be closed
InvalidSessionException
- If sessionID identifies an invalid
session
SessionServiceException
public MetaMatrixSessionInfo createSession(java.lang.String userName, Credentials credentials, java.io.Serializable trustedToken, java.lang.String applicationName, java.util.Properties properties) throws MetaMatrixAuthenticationException, SessionServiceException
SessionServiceInterface
Credentials
.
createSession
in interface SessionServiceInterface
MetaMatrixAuthenticationException
SessionServiceException
public void setIdGenerator(DBIDController idGenerator)
public java.util.Collection<MetaMatrixSessionInfo> getActiveSessions() throws SessionServiceException
SessionServiceInterface
getActiveSessions
in interface SessionServiceInterface
SessionServiceException
public int getActiveSessionsCount() throws SessionServiceException
SessionServiceInterface
getActiveSessionsCount
in interface SessionServiceInterface
SessionServiceException
public MetaMatrixPrincipal getPrincipal(MetaMatrixSessionID sessionID) throws InvalidSessionException, SessionServiceException
SessionServiceInterface
getPrincipal
in interface SessionServiceInterface
sessionID
- MetaMatrixSessionID representing the session
InvalidSessionException
SessionServiceException
public java.util.Collection<MetaMatrixSessionInfo> getSessionsLoggedInToVDB(java.lang.String VDBName, java.lang.String VDBVersion) throws SessionServiceException, ServiceStateException
SessionServiceInterface
MetaMatrixSessionID
s that are in the ACTIVE state
and currently logged in to a VDB.
getSessionsLoggedInToVDB
in interface SessionServiceInterface
VDBName
- The name of the VDB.VDBVersion
- The version of the VDB.
SessionServiceException
- when transaction with database fails or unexpected exception happens
ServiceStateException
public void pingServer(MetaMatrixSessionID sessionID) throws ServiceStateException, InvalidSessionException
SessionServiceInterface
pingServer
in interface SessionServiceInterface
sessionID
- - identifies the client
ServiceStateException
InvalidSessionException
public boolean terminateSession(MetaMatrixSessionID terminatedSessionID, MetaMatrixSessionID adminSessionID) throws AuthorizationException, SessionServiceException
SessionServiceInterface
terminateSession
in interface SessionServiceInterface
terminatedSessionID
- The MetaMatrixSessionID identifying user's session
to be terminatedadminSessionID
- The session id identifying session of administrator
AuthorizationException
- if the caller denoted by adminSessionID
does not have authority to terminate the terminatedSessionID
session
SessionServiceException
public MetaMatrixSessionInfo validateSession(MetaMatrixSessionID sessionID) throws InvalidSessionException, SessionServiceException
SessionServiceInterface
validateSession
in interface SessionServiceInterface
sessionID
- MetaMatrixSessionID representing the session
InvalidSessionException
- If sessionID identifies an invalid
session
SessionServiceException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |