org.teiid.dqp.service
Interface SessionService


public interface SessionService

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 long DEFAULT_MAX_SESSIONS
           
static long DEFAULT_SESSION_EXPIRATION
           
static java.lang.String MAX_SESSIONS
           
static java.lang.String NAME
           
static java.lang.String SESSION_EXPIRATION
           
 
Method Summary
 void closeSession(java.lang.String sessionID)
          Closes the specified session.
 SessionMetadata createSession(java.lang.String userName, Credentials credentials, java.lang.String applicationName, java.util.Properties properties, boolean admin, boolean authenticate)
          Create a session for the given user authenticating against the given Credentials.
 SessionMetadata getActiveSession(java.lang.String sessionID)
           
 java.util.Collection<SessionMetadata> getActiveSessions()
          Get the collection of active user sessions on the system.
 int getActiveSessionsCount()
          Get the number of active user sessions on the system.
 java.util.Collection<SessionMetadata> getSessionsLoggedInToVDB(java.lang.String VDBName, int VDBVersion)
          Get all MetaMatrixSessionIDs that are in the ACTIVE state and currently logged in to a VDB.
 void pingServer(java.lang.String sessionID)
          Periodically called by the client to indicate the client is still alive.
 void setDqp(org.teiid.dqp.internal.process.DQPCore dqp)
           
 boolean terminateSession(java.lang.String terminatedSessionID, java.lang.String adminSessionID)
          Terminates the specified session.
 SessionMetadata validateSession(java.lang.String 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.
 

Field Detail

NAME

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

DEFAULT_MAX_SESSIONS

static final long DEFAULT_MAX_SESSIONS
See Also:
Constant Field Values

DEFAULT_SESSION_EXPIRATION

static final long DEFAULT_SESSION_EXPIRATION
See Also:
Constant Field Values

MAX_SESSIONS

static final java.lang.String MAX_SESSIONS
See Also:
Constant Field Values

SESSION_EXPIRATION

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

createSession

SessionMetadata createSession(java.lang.String userName,
                              Credentials credentials,
                              java.lang.String applicationName,
                              java.util.Properties properties,
                              boolean admin,
                              boolean authenticate)
                              throws javax.security.auth.login.LoginException,
                                     SessionServiceException
Create a session for the given user authenticating against the given Credentials.

Throws:
javax.security.auth.login.LoginException
SessionServiceException

closeSession

void closeSession(java.lang.String sessionID)
                  throws InvalidSessionException
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(java.lang.String terminatedSessionID,
                         java.lang.String adminSessionID)
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 does not have authority to terminate the terminatedSessionID session
SessionServiceException

getActiveSessions

java.util.Collection<SessionMetadata> 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

validateSession

SessionMetadata validateSession(java.lang.String 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<SessionMetadata> getSessionsLoggedInToVDB(java.lang.String VDBName,
                                                               int 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(java.lang.String sessionID)
                throws InvalidSessionException
Periodically called by the client to indicate the client is still alive.

Parameters:
sessionID - - identifies the client
Throws:
InvalidSessionException

getActiveSession

SessionMetadata getActiveSession(java.lang.String sessionID)

setDqp

void setDqp(org.teiid.dqp.internal.process.DQPCore dqp)


Copyright © 2010. All Rights Reserved.