com.metamatrix.platform.security.api.service
Interface SessionServiceInterface

All Superinterfaces:
ServiceInterface
All Known Implementing Classes:
SessionServiceImpl

public interface SessionServiceInterface
extends ServiceInterface

The session service deals with managing sessions; this involves creating sessions, closing sessions, terminating sessions, and updating session state.

A session has a timestamp, information about the principal owning the session, and a "state" indicating whether it is actively in use, in use but passivated, or has been rendered invalid by being closed or terminated, or by expiring.

Note that this service does not deal with authentication explicitly, but may use a membership service provider to authenticate some requests.


Field Summary
static java.lang.String NAME
           
 
Fields inherited from interface com.metamatrix.platform.service.api.ServiceInterface
WAIT_TO_DIE_TIME
 
Method Summary
 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 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 getSessionsLoggedInToVDB(java.lang.String VDBName, java.lang.String VDBVersion)
          Get all MetaMatrixSessionIDs that are in the ACTIVE state and currently logged in to a VDB.
 void pingServer(MetaMatrixSessionID sessionID)
          Periodically called by the client to indicate the client is still alive.
 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.
 
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
 

Field Detail

NAME

static final java.lang.String NAME
See Also:
Constant Field Values
Method Detail

createSession

MetaMatrixSessionInfo createSession(java.lang.String userName,
                                    Credentials credentials,
                                    java.io.Serializable trustedToken,
                                    java.lang.String applicationName,
                                    java.util.Properties properties)
                                    throws MetaMatrixAuthenticationException,
                                           SessionServiceException
Create a session for the given user authenticating against the given Credentials.

Throws:
MetaMatrixAuthenticationException
SessionServiceException

closeSession

void closeSession(MetaMatrixSessionID sessionID)
                  throws InvalidSessionException,
                         SessionServiceException
Closes the specified session.

Parameters:
sessionID - The MetaMatrixSessionID identifying user's session to be closed
Throws:
InvalidSessionException - If sessionID identifies an invalid session
SessionServiceException

terminateSession

boolean terminateSession(MetaMatrixSessionID terminatedSessionID,
                         MetaMatrixSessionID adminSessionID)
                         throws InvalidSessionException,
                                AuthorizationException,
                                SessionServiceException
Terminates the specified session. This is an administrative action.

Parameters:
terminatedSessionID - The MetaMatrixSessionID identifying user's session to be terminated
adminSessionID - The session id identifying session of administrator
Throws:
InvalidSessionException - If terminatedSessionID identifies an invalid session
AuthorizationException - if the caller denoted by adminSessionID does not have authority to terminate the terminatedSessionID session
SessionServiceException

getActiveSessions

java.util.Collection getActiveSessions()
                                       throws SessionServiceException
Get the collection of active user sessions on the system.

Returns:
The collection of MetaMatrixSessionInfo objects of active users on the system - possibly empty, never null.
Throws:
SessionServiceException

getActiveSessionsCount

int getActiveSessionsCount()
                           throws SessionServiceException
Get the number of active user sessions on the system.

Returns:
int
Throws:
SessionServiceException

getPrincipal

MetaMatrixPrincipal getPrincipal(MetaMatrixSessionID sessionID)
                                 throws InvalidSessionException,
                                        SessionServiceException
Returns a MetaMatrixPrincipal object describing the owner (user) of the indicated session.

Parameters:
sessionID - MetaMatrixSessionID representing the session
Returns:
MetaMatrixPrincipal object describing the owner of the indicated session.
Throws:
InvalidSessionException
SessionServiceException

validateSession

MetaMatrixSessionInfo validateSession(MetaMatrixSessionID sessionID)
                                      throws InvalidSessionException,
                                             SessionServiceException
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.

Parameters:
sessionID - MetaMatrixSessionID representing the session
Returns:
SessionToken object identifying the session
Throws:
InvalidSessionException - If sessionID identifies an invalid session
SessionServiceException

getSessionsLoggedInToVDB

java.util.Collection getSessionsLoggedInToVDB(java.lang.String VDBName,
                                              java.lang.String VDBVersion)
                                              throws SessionServiceException
Get all MetaMatrixSessionIDs that are in the ACTIVE state and currently logged in to a VDB.

Parameters:
VDBName - The name of the VDB.
VDBVersion - The version of the VDB.
Throws:
SessionServiceException - when transaction with database fails or unexpected exception happens

pingServer

void pingServer(MetaMatrixSessionID sessionID)
                throws InvalidSessionException
Periodically called by the client to indicate the client is still alive.

Parameters:
sessionID - - identifies the client
Throws:
InvalidSessionException


Copyright © 2009. All Rights Reserved.