org.teiid.services
Class SessionServiceImpl

java.lang.Object
  extended by org.teiid.services.SessionServiceImpl
All Implemented Interfaces:
SessionService

public class SessionServiceImpl
extends java.lang.Object
implements SessionService

This class serves as the primary implementation of the Session Service.


Field Summary
static java.lang.String SECURITY_DOMAINS
           
 
Fields inherited from interface org.teiid.dqp.service.SessionService
DEFAULT_MAX_SESSIONS, DEFAULT_SESSION_EXPIRATION, MAX_SESSIONS, NAME, SESSION_EXPIRATION
 
Constructor Summary
SessionServiceImpl()
           
 
Method Summary
protected  TeiidLoginContext authenticate(java.lang.String userName, Credentials credentials, java.lang.String applicationName, java.util.List<java.lang.String> domains, SecurityHelper helper, boolean onlyallowPassthrough)
           
 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 adminConnection, 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.
 long getSessionExpirationTimeLimit()
           
 long getSessionMaxLimit()
           
 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 setAdminSecurityDomain(java.lang.String domain)
           
 void setDqp(org.teiid.dqp.internal.process.DQPCore dqp)
           
 void setSecurityDomains(java.lang.String domainNameOrder)
           
 void setSecurityHelper(SecurityHelper securityHelper)
           
 void setSessionExpirationTimeLimit(long limit)
           
 void setSessionMaxLimit(long limit)
           
 void setVDBRepository(VDBRepository repo)
           
 void start()
           
 void stop()
           
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SECURITY_DOMAINS

public static final java.lang.String SECURITY_DOMAINS
See Also:
Constant Field Values
Constructor Detail

SessionServiceImpl

public SessionServiceImpl()
Method Detail

closeSession

public void closeSession(java.lang.String sessionID)
                  throws InvalidSessionException
Description copied from interface: SessionService
Closes the specified session.

Specified by:
closeSession in interface SessionService
Parameters:
sessionID - The MetaMatrixSessionID identifying user's session to be closed
Throws:
InvalidSessionException - If sessionID identifies an invalid session

createSession

public SessionMetadata createSession(java.lang.String userName,
                                     Credentials credentials,
                                     java.lang.String applicationName,
                                     java.util.Properties properties,
                                     boolean adminConnection,
                                     boolean authenticate)
                              throws javax.security.auth.login.LoginException,
                                     SessionServiceException
Description copied from interface: SessionService
Create a session for the given user authenticating against the given Credentials.

Specified by:
createSession in interface SessionService
Throws:
javax.security.auth.login.LoginException
SessionServiceException

authenticate

protected TeiidLoginContext authenticate(java.lang.String userName,
                                         Credentials credentials,
                                         java.lang.String applicationName,
                                         java.util.List<java.lang.String> domains,
                                         SecurityHelper helper,
                                         boolean onlyallowPassthrough)
                                  throws javax.security.auth.login.LoginException
Throws:
javax.security.auth.login.LoginException

getActiveSessions

public java.util.Collection<SessionMetadata> getActiveSessions()
                                                        throws SessionServiceException
Description copied from interface: SessionService
Get the collection of active user sessions on the system.

Specified by:
getActiveSessions in interface SessionService
Returns:
The collection of MetaMatrixSessionInfo objects of active users on the system - possibly empty, never null.
Throws:
SessionServiceException

getActiveSession

public SessionMetadata getActiveSession(java.lang.String sessionID)
Specified by:
getActiveSession in interface SessionService

getActiveSessionsCount

public int getActiveSessionsCount()
                           throws SessionServiceException
Description copied from interface: SessionService
Get the number of active user sessions on the system.

Specified by:
getActiveSessionsCount in interface SessionService
Returns:
int
Throws:
SessionServiceException

getSessionsLoggedInToVDB

public java.util.Collection<SessionMetadata> getSessionsLoggedInToVDB(java.lang.String VDBName,
                                                                      int vdbVersion)
                                                               throws SessionServiceException
Description copied from interface: SessionService
Get all MetaMatrixSessionIDs that are in the ACTIVE state and currently logged in to a VDB.

Specified by:
getSessionsLoggedInToVDB in interface SessionService
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

public void pingServer(java.lang.String sessionID)
                throws InvalidSessionException
Description copied from interface: SessionService
Periodically called by the client to indicate the client is still alive.

Specified by:
pingServer in interface SessionService
Parameters:
sessionID - - identifies the client
Throws:
InvalidSessionException

terminateSession

public boolean terminateSession(java.lang.String terminatedSessionID,
                                java.lang.String adminSessionID)
Description copied from interface: SessionService
Terminates the specified session. This is an administrative action.

Specified by:
terminateSession in interface SessionService
Parameters:
terminatedSessionID - The MetaMatrixSessionID identifying user's session to be terminated
adminSessionID - The session id identifying session of administrator

validateSession

public SessionMetadata validateSession(java.lang.String sessionID)
                                throws InvalidSessionException,
                                       SessionServiceException
Description copied from interface: SessionService
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.

Specified by:
validateSession in interface SessionService
Parameters:
sessionID - MetaMatrixSessionID representing the session
Returns:
SessionToken object identifying the session
Throws:
InvalidSessionException - If sessionID identifies an invalid session
SessionServiceException

getSessionMaxLimit

public long getSessionMaxLimit()

setSessionMaxLimit

public void setSessionMaxLimit(long limit)

getSessionExpirationTimeLimit

public long getSessionExpirationTimeLimit()

setSessionExpirationTimeLimit

public void setSessionExpirationTimeLimit(long limit)

setSecurityDomains

public void setSecurityDomains(java.lang.String domainNameOrder)

setAdminSecurityDomain

public void setAdminSecurityDomain(java.lang.String domain)

start

public void start()

stop

public void stop()

setVDBRepository

public void setVDBRepository(VDBRepository repo)

setSecurityHelper

public void setSecurityHelper(SecurityHelper securityHelper)

setDqp

public void setDqp(org.teiid.dqp.internal.process.DQPCore dqp)
Specified by:
setDqp in interface SessionService


Copyright © 2011. All Rights Reserved.