Package org.teiid.services
Class SessionServiceImpl
- java.lang.Object
-
- org.teiid.services.SessionServiceImpl
-
- All Implemented Interfaces:
SessionService
public class SessionServiceImpl extends Object implements SessionService
This class serves as the primary implementation of the Session Service.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SessionServiceImpl.Authentication
-
Field Summary
Fields Modifier and Type Field Description static String
AT
static String
AUTHENTICATION_TYPE_PROPERTY
static String
MAX_SESSIONS_PER_USER
static String
SECURITY_DOMAIN_PROPERTY
protected SecurityHelper
securityHelper
-
Fields inherited from interface org.teiid.dqp.service.SessionService
DEFAULT_MAX_SESSIONS, DEFAULT_SESSION_EXPIRATION, NAME
-
-
Constructor Summary
Constructors Constructor Description SessionServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
closeSession(String sessionID)
Closes the specified session.SessionMetadata
createSession(String vdbName, String vdbVersion, AuthenticationType authType, String userName, Credentials credentials, String applicationName, Properties properties)
Create a session for the given user authenticating against the givenCredentials
.SessionMetadata
getActiveSession(String sessionID)
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.protected VDBMetaData
getActiveVDB(String vdbName, String vdbVersion)
AuthenticationType
getAuthenticationType(String vdbName, String version, String userName)
AuthenticationType
getDefaultAuthenticationType()
String
getSecurityDomain(String vdbName, String version, VDB vdb)
SecurityHelper
getSecurityHelper()
long
getSessionExpirationTimeLimit()
long
getSessionMaxLimit()
Collection<SessionMetadata>
getSessionsLoggedInToVDB(VDBKey key)
Get all Sessions that are in the ACTIVE state and currently logged in to a VDB.Collection<SessionMetadata>
getSessionsLoggedInToVDB(VDBKey key, String username)
boolean
isTrustAllLocal()
GSSResult
neogitiateGssLogin(String user, String vdbName, String vdbVersion, byte[] serviceTicket)
void
pingServer(String sessionID)
Periodically called by the client to indicate the client is still alive.void
setAuthenticationType(AuthenticationType flag)
void
setDqp(DQPCore dqp)
void
setSecurityDomain(String domainName)
void
setSecurityHelper(SecurityHelper securityHelper)
void
setSessionExpirationTimeLimit(long limit)
void
setSessionMaxLimit(long limit)
void
setTrustAllLocal(boolean trustAllLocal)
void
setVDBRepository(VDBRepository repo)
void
start()
void
stop()
boolean
terminateSession(String terminatedSessionID, String adminSessionID)
Terminates the specified session.SessionMetadata
validateSession(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
-
SECURITY_DOMAIN_PROPERTY
public static final String SECURITY_DOMAIN_PROPERTY
- See Also:
- Constant Field Values
-
AUTHENTICATION_TYPE_PROPERTY
public static final String AUTHENTICATION_TYPE_PROPERTY
- See Also:
- Constant Field Values
-
MAX_SESSIONS_PER_USER
public static final String MAX_SESSIONS_PER_USER
- See Also:
- Constant Field Values
-
AT
public static final String AT
- See Also:
- Constant Field Values
-
securityHelper
protected SecurityHelper securityHelper
-
-
Method Detail
-
setSecurityDomain
public void setSecurityDomain(String domainName)
-
closeSession
public void closeSession(String sessionID) throws InvalidSessionException
Description copied from interface:SessionService
Closes the specified session.- Specified by:
closeSession
in interfaceSessionService
- Throws:
InvalidSessionException
-
createSession
public SessionMetadata createSession(String vdbName, String vdbVersion, AuthenticationType authType, String userName, Credentials credentials, String applicationName, Properties properties) throws LoginException, SessionServiceException
Description copied from interface:SessionService
Create a session for the given user authenticating against the givenCredentials
.- Specified by:
createSession
in interfaceSessionService
- Throws:
LoginException
SessionServiceException
-
getActiveVDB
protected VDBMetaData getActiveVDB(String vdbName, String vdbVersion) throws SessionServiceException
- Parameters:
vdbName
-vdbVersion
-- Returns:
- the vdb or null if it doesn't exist
- Throws:
SessionServiceException
- if the version is not valid or the vdb doesn't accept connections
-
getActiveSessions
public Collection<SessionMetadata> getActiveSessions()
Description copied from interface:SessionService
Get the collection of active user sessions on the system.- Specified by:
getActiveSessions
in interfaceSessionService
- Returns:
- The collection of Session objects of active users on the system - possibly empty, never null.
-
getActiveSession
public SessionMetadata getActiveSession(String sessionID)
- Specified by:
getActiveSession
in interfaceSessionService
-
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 interfaceSessionService
- Returns:
- int
- Throws:
SessionServiceException
-
getSessionsLoggedInToVDB
public Collection<SessionMetadata> getSessionsLoggedInToVDB(VDBKey key)
Description copied from interface:SessionService
Get all Sessions that are in the ACTIVE state and currently logged in to a VDB.- Specified by:
getSessionsLoggedInToVDB
in interfaceSessionService
-
getSessionsLoggedInToVDB
public Collection<SessionMetadata> getSessionsLoggedInToVDB(VDBKey key, String username)
-
pingServer
public void pingServer(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 interfaceSessionService
- Parameters:
sessionID
- - identifies the client- Throws:
InvalidSessionException
-
terminateSession
public boolean terminateSession(String terminatedSessionID, String adminSessionID)
Description copied from interface:SessionService
Terminates the specified session. This is an administrative action.- Specified by:
terminateSession
in interfaceSessionService
- Parameters:
terminatedSessionID
- The SessionID identifying user's session to be terminatedadminSessionID
- The session id identifying session of administrator
-
validateSession
public SessionMetadata validateSession(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 interfaceSessionService
- Parameters:
sessionID
- SessionID representing the session- Returns:
- Session object identifying the session
- Throws:
InvalidSessionException
SessionServiceException
-
getSessionMaxLimit
public long getSessionMaxLimit()
-
setSessionMaxLimit
public void setSessionMaxLimit(long limit)
-
getSessionExpirationTimeLimit
public long getSessionExpirationTimeLimit()
-
setSessionExpirationTimeLimit
public void setSessionExpirationTimeLimit(long limit)
-
setAuthenticationType
public void setAuthenticationType(AuthenticationType flag)
-
start
public void start()
-
stop
public void stop()
-
setVDBRepository
public void setVDBRepository(VDBRepository repo)
-
setSecurityHelper
public void setSecurityHelper(SecurityHelper securityHelper)
-
setDqp
public void setDqp(DQPCore dqp)
- Specified by:
setDqp
in interfaceSessionService
-
getSecurityHelper
public SecurityHelper getSecurityHelper()
- Specified by:
getSecurityHelper
in interfaceSessionService
-
getAuthenticationType
public AuthenticationType getAuthenticationType(String vdbName, String version, String userName) throws LogonException
- Specified by:
getAuthenticationType
in interfaceSessionService
- Throws:
LogonException
-
neogitiateGssLogin
public GSSResult neogitiateGssLogin(String user, String vdbName, String vdbVersion, byte[] serviceTicket) throws LoginException, LogonException
- Specified by:
neogitiateGssLogin
in interfaceSessionService
- Throws:
LoginException
LogonException
-
getDefaultAuthenticationType
public AuthenticationType getDefaultAuthenticationType()
- Specified by:
getDefaultAuthenticationType
in interfaceSessionService
-
isTrustAllLocal
public boolean isTrustAllLocal()
-
setTrustAllLocal
public void setTrustAllLocal(boolean trustAllLocal)
-
-