Package oracle.security.xs
Class XSSessionManager
- java.lang.Object
-
- oracle.security.xs.XSSessionManager
-
public abstract class XSSessionManager extends java.lang.ObjectThis class provides functions to manage theSession, inlcude session life cycle (createSession, attachSession, detachSessiona and destroySession), session attribute (cookie, inactivity timeout) and session namespace. It also provides functions to initialize the middle-tier cache and manage it. The following code snippet provides a typical use of this class:XSSessionManager manager = XSSessionManager.getSessionManager(cacheConn, 30, 2048000); Session lws = manager.createSession(lwsConn, user, cookie); manager.attachSession(lws_conn, lws, ...); boolean ret = XSAccessController.checkPrivilege(lws, "UPDATE"); manager.detachSession(lws); manager.destroySession(lws);Most of the methods in this class are not static, and very security sensitive. The caller has to get hold of an object to call the methods. The object is highly protected. The only way to get the object is to call getSessionManager with followings:- XSSecurityPermission ("initSecurityManager") to be granted to the caller's code - Dispatcher's DB connection or DatasourceIn the integration case, we expect only trusted layer (OPSS) can initialize and get hold of the the XSSessionManager object. Application code should not be able to get hold of the object and further invoke most of the methods.
-
-
Constructor Summary
Constructors Constructor Description XSSessionManager()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract voidabortSession(Session session)Detaches this session.abstract voidassignUser(Session session, java.lang.String targetUser, java.util.Collection<java.lang.String> enabledDynamicRoles, java.util.Collection<java.lang.String> disabledDynamicRoles, java.util.Collection<NamespaceValue> namespaceValues, java.sql.Timestamp authenticationTime)Assigns an XS user to the session that was previously created for anonymous user.abstract voidassignUser(Session session, ExternalUser targetUser, java.util.Collection<java.lang.String> enabledDynamicRoles, java.util.Collection<java.lang.String> disabledDynamicRoles, java.util.Collection<ExternalRole> externalRoles, java.util.Collection<NamespaceValue> namespaceValues, java.sql.Timestamp authenticationTime)Assigns an external user to the session that was previously created for anonymous user.abstract voidattachSession(java.sql.Connection conn, Session session, java.util.Collection<java.lang.String> enabledDynamicRoles, java.util.Collection<java.lang.String> disabledDynamicRoles, java.util.Collection<ExternalRole> externalRoles, java.util.Collection<NamespaceValue> namespaceValues, java.sql.Timestamp authenticationTime)Attaches the JDBC connection to the specified XS user's session.abstract voidattachSession(java.sql.Connection conn, Session session, java.util.Collection<java.lang.String> enabledDynamicRoles, java.util.Collection<java.lang.String> disabledDynamicRoles, java.util.Collection<NamespaceValue> namespaceValues, java.sql.Timestamp authenticationTime)Attaches the JDBC connection to the specified XS user's session.abstract SessionattachSessionByCookie(java.sql.Connection conn, java.lang.String cookie, java.util.Collection<java.lang.String> enabledDynamicRoles, java.util.Collection<java.lang.String> disabledDynamicRoles, java.util.Collection<ExternalRole> externalRoles, java.util.Collection<NamespaceValue> namespaceValues, java.sql.Timestamp authenticationTime)Attaches the corresponding session for a specified cookie and returns the Session object.abstract SessionattachSessionByID(java.sql.Connection conn, java.lang.String id, java.util.Collection<java.lang.String> enabledDynamicRoles, java.util.Collection<java.lang.String> disabledDynamicRoles, java.util.Collection<ExternalRole> externalRoles, java.util.Collection<NamespaceValue> namespaceValues, java.sql.Timestamp authenticationTime)Attaches the corresponding session for a specified ID and returns the Session object.abstract voidclearCache()Explicitly clears the shared cache from the middle tier.abstract SessioncreateAnonymousSession(java.sql.Connection conn, java.lang.String cookie, java.util.Collection<NamespaceValue> namespaceValues)Creates an anonymousSessionfor XS user (to be assigned to) on the server as well as its corresponding middle-tier representation.abstract SessioncreateAnonymousSessionTrusted(java.sql.Connection conn, java.lang.String cookie, java.util.Collection<NamespaceValue> namespaceValues)Creates an anonymousSessionin trusted mode on the server for external user (to be assigned to) as well as its corresponding middle-tier representation.abstract SessionNamespaceAttributecreateAttribute(SessionNamespace sessionNS, java.lang.String name, java.lang.String value, java.util.List<SessionNamespace.ATTR_EVENT_TYPE> event)Creates a new attribute in the namespace with the specified name, value, and event.abstract SessionNamespacecreateNamespace(Session session, java.lang.String name)Creates a new namespace for the given session.abstract SessioncreateSession(java.sql.Connection conn, java.lang.String user, java.lang.String cookie, java.util.Collection<NamespaceValue> namespaceValues)Creates aSessionobject on the server as well as its corresponding midtier representation.abstract SessioncreateSession(java.sql.Connection conn, ExternalUser externalUser, java.lang.String cookie, java.util.Collection<NamespaceValue> namespaceValues)Creates aSessionobject for specified external user on the server as well as its corresponding middle-tier representation.abstract SessioncreateSessionTrusted(java.sql.Connection conn, ExternalUser externalUser, java.lang.String cookie, java.util.Collection<NamespaceValue> namespaceValues)Creates aSessionobject for specified external user in trusted mode on the server as well as its corresponding middle-tier representation.abstract voiddeleteAttribute(SessionNamespace sessionNS, java.lang.String name)Deletes the specified attribute The dispatcher needs to have the privilege to delete the given attributeabstract voiddeleteNamespace(Session session, java.lang.String namespace)Removes a namespace from the session.abstract voiddestroySession(java.sql.Connection conn, Session session)Destroys the XS session.abstract voiddetachSession(Session session)Detaches this session.abstract intgetCacheMaxIdleTime()Returns the maximum number of minutes for which the cache can remain without any activityabstract longgetCacheMaxSize()Returns the maximum cache size, in bytes.abstract floatgetHighWaterMark()Gets the high watermark for the cache.abstract floatgetLowWaterMark()Gets the low watermark for the cache.abstract intgetPrivateCacheMaxEntries()Returns the maximum number of entries that the ACL evaluation result can be cached in the session.static XSSessionManagergetSessionManager(java.sql.Connection conn, int cacheMaxIdleTime, int cacheMaxsize)Initializes anXSSessionManagerusing a dedicated connections.static XSSessionManagergetSessionManager(javax.sql.DataSource datasource, int cacheMaxIdleTime, int cacheMaxsize)Initializes anXSSessionManagerusing connections from the connection pool.abstract SessionNamespaceAttributeresetAttribute(SessionNamespace sessionNS, java.lang.String name)Resets the specified attribute in the namespace to its default value.abstract voidsaveSession(Session session)Saves the specified session leaving it attached.abstract SessionNamespaceAttributesetAttribute(SessionNamespace sessionNS, java.lang.String name, java.lang.String value)Sets the attribute for a session namespace with the specified name and value The dispatcher needs to have the privilege to set the attribute on the given namespaceabstract voidsetCacheMaxIdleTime(int minutes)Sets the maximum number of minutes for which the cache can remain without any activity.abstract voidsetCacheMaxSize(long megaBytes)Sets the size of the cache on the middle tier, in bytes.abstract voidsetCookie(Session session, java.lang.String cookie)Sets the cookie for the sessionabstract voidsetInactivityTimeout(Session session, int minutes)Sets the inactivity timeout for the session in minutes.abstract voidsetPrivateCacheMaxEntries(int maxEntries)Sets the maximum number of entries that the ACL evaluation result can be cached in the session.abstract voidsetWaterMark(float low, float high)Sets the high and low watermarks for the cache.
-
-
-
Method Detail
-
createSession
public abstract Session createSession(java.sql.Connection conn, java.lang.String user, java.lang.String cookie, java.util.Collection<NamespaceValue> namespaceValues) throws InvalidXSUserException, AccessDeniedException, java.sql.SQLException, XSException, InvalidXSNamespaceException
Creates aSessionobject on the server as well as its corresponding midtier representation. It also creates or changes theNamespacespecified in theSession. The cookie can be used to identify the newly created XS user session in future calls, until the cookie value is changed or the session is destroyed. By default, the session is created in secure mode.- Parameters:
conn- the JDBC connection for server roundtripuser- the XS user associated with theSessioncookie- used to identify the sessionnamespaceValues- the namespace with attributes Theusermust have thebindNamespaceprivilege.- Returns:
- session the
Sessionobject - Throws:
AccessDeniedException- if the current user does not have the privilege to create this sessionjava.sql.SQLException- if a JDBC exception happensInvalidXSUserException- if an invalid XS user is specifiedXSException- if a generic error is detectedInvalidXSNamespaceException- if an invalid namespace is specified- See Also:
Session,SessionNamespace
-
createAnonymousSession
public abstract Session createAnonymousSession(java.sql.Connection conn, java.lang.String cookie, java.util.Collection<NamespaceValue> namespaceValues) throws InvalidXSUserException, AccessDeniedException, java.sql.SQLException, XSException, InvalidXSNamespaceException
Creates an anonymousSessionfor XS user (to be assigned to) on the server as well as its corresponding middle-tier representation. It also creates or changes theNamespacespecified in theSession. The user for this session is a seeded anonymous user. The cookie can be used to identify the newly created XS user session in future calls, until the cookie value is changed or the session is destroyed. It is possible to assign a specific user to take over this session that will keep some of the state of the session.By default, the session is created in secure mode.
- Parameters:
conn- the JDBC connection for server roundtripcookie- used to identify the sessionnamespaceValues- a list of namespaces with attributes- Returns:
- Throws:
AccessDeniedException- if the current user does not have the privilege to create this sessionjava.sql.SQLException- if a JDBC exception happensInvalidXSUserException- if an invalid XS user is specifiedXSException- if a generic error is detectedInvalidXSNamespaceException- if an invalid namespace is specified- See Also:
Session,SessionNamespace
-
createAnonymousSessionTrusted
public abstract Session createAnonymousSessionTrusted(java.sql.Connection conn, java.lang.String cookie, java.util.Collection<NamespaceValue> namespaceValues) throws InvalidXSUserException, AccessDeniedException, java.sql.SQLException, XSException, InvalidXSNamespaceException
Creates an anonymousSessionin trusted mode on the server for external user (to be assigned to) as well as its corresponding middle-tier representation. It also creates or changes theNamespacespecified in theSession. The session is going to be assigned to an extenal user, which has no footprint at Database, so no database role is enabled in the session. The user for this session is a seeded anonymous user. The cookie can be used to identify the newly created session in future calls, until the cookie value is changed or the session is destroyed. It is possible to assign a specific external user to take over this session that will keep some of the state of the session.- Parameters:
conn- the JDBC connection for server roundtripcookie- used to identify the sessionnamespaceValues- a list of namespaces with attributes- Returns:
- Throws:
AccessDeniedException- if the current user does not have the privilege to create this sessionjava.sql.SQLException- if a JDBC exception happensInvalidXSUserException- if an invalid XS user is specifiedXSException- if a generic error is detectedInvalidXSNamespaceException- if an invalid namespace is specified- See Also:
Session,SessionNamespace
-
saveSession
public abstract void saveSession(Session session) throws java.sql.SQLException, NotAttachedException, XSException
Saves the specified session leaving it attached. It commits all the changes on the session. The changes can be related to namespace, user, role, and other session attributes. For committing changes, this method is same as the detachSession. The only difference is that it does not detach from the connection, but stay attached. This is a server roundtrip.- Parameters:
session- , aSessionobject- Throws:
java.sql.SQLExceptionNotAttachedExceptionXSException
-
createSessionTrusted
public abstract Session createSessionTrusted(java.sql.Connection conn, ExternalUser externalUser, java.lang.String cookie, java.util.Collection<NamespaceValue> namespaceValues) throws InvalidXSUserException, AccessDeniedException, java.sql.SQLException, XSException, InvalidXSNamespaceException
Creates aSessionobject for specified external user in trusted mode on the server as well as its corresponding middle-tier representation. It also creates or changes theNamespacespecified in theSession. The cookie can be used to identify the newly session in future calls, until the cookie value is changed or the session is destroyed.- Parameters:
conn- the JDBC connection for server roundtripexternalUser- the external user associated with theSessioncookie- used to identify the sessionnamespaceValues- the namespace with attributes- Returns:
- session the
Sessionobject - Throws:
AccessDeniedException- if the current user does not have the privilege to create this sessionjava.sql.SQLException- if a JDBC exception happensInvalidXSUserException- if an invalid XS user is specifiedXSException- if a generic error is detectedInvalidXSNamespaceException- if an invalid namespace is specified- See Also:
Session,SessionNamespace
-
createSession
public abstract Session createSession(java.sql.Connection conn, ExternalUser externalUser, java.lang.String cookie, java.util.Collection<NamespaceValue> namespaceValues) throws InvalidXSUserException, AccessDeniedException, java.sql.SQLException, XSException, InvalidXSNamespaceException
Creates aSessionobject for specified external user on the server as well as its corresponding middle-tier representation. It also creates or changes theNamespacespecified for theSession.The cookie can be used to identify the newly created XS user session in future calls, until the cookie value is changed or the session is destroyed. By default, the session is in secure mode
- Parameters:
conn- the JDBC connection for server roundtripexternalUser- the external user associated with theSessioncookie- used to identify the sessionnamespaceValues- the namespace with attributes- Returns:
- session the
Sessionobject - Throws:
AccessDeniedException- if the current user does not have the privilege to create this sessionjava.sql.SQLException- if a JDBC exception happensInvalidXSUserException- if an invalid XS user is specifiedXSException- if a generic error is detectedInvalidXSNamespaceException- if an invalid namespace is specified- See Also:
Session,SessionNamespace
-
attachSessionByCookie
public abstract Session attachSessionByCookie(java.sql.Connection conn, java.lang.String cookie, java.util.Collection<java.lang.String> enabledDynamicRoles, java.util.Collection<java.lang.String> disabledDynamicRoles, java.util.Collection<ExternalRole> externalRoles, java.util.Collection<NamespaceValue> namespaceValues, java.sql.Timestamp authenticationTime) throws java.sql.SQLException, AccessDeniedException, InvalidSessionException, XSException, InvalidXSNamespaceException
Attaches the corresponding session for a specified cookie and returns the Session object. At same time, changes the dynamic roles, external roles, namespaces, and authentication time on the session. Dynamic roles, external roles, and namespace with attributes are supported in this operation.- Parameters:
conn- the JDBC connection for server roundtripcookie- the cookie stringenabledDynamicRoles- the enabled dynamic roles listdisabledDynamicRoles- the disabled dyamic roles listexternalRoles- the external roles listnamespaceValues- the namespaces with attributes.authenticationTime- the authentication time- Returns:
- a
Sessionobject - Throws:
AccessDeniedException- if the current user does not have the privilege to create this sessionjava.sql.SQLException- if a JDBC exception happensInvalidXSUserException- if an invalid XS user is specifiedXSException- if a generic error is detectedInvalidXSNamespaceException- if an invalid namespace is specifiedInvalidSessionException
-
attachSessionByID
public abstract Session attachSessionByID(java.sql.Connection conn, java.lang.String id, java.util.Collection<java.lang.String> enabledDynamicRoles, java.util.Collection<java.lang.String> disabledDynamicRoles, java.util.Collection<ExternalRole> externalRoles, java.util.Collection<NamespaceValue> namespaceValues, java.sql.Timestamp authenticationTime) throws java.sql.SQLException, AccessDeniedException, InvalidSessionException, XSException, InvalidXSNamespaceException
Attaches the corresponding session for a specified ID and returns the Session object. At same time, changes the dynamic roles, external roles, namespaces, and authentication time on the session.- Parameters:
conn- the JDBC connection for server roundtripid- the session ID of the sessionenabledDynamicRoles- the enabled dynamic roles listdisabledDynamicRoles- the disabled dyamic roles listexternalRoles- the external roles listnamespaceValues- the namespaces with attributes.authenticationTime- the authentication time- Returns:
- a
Sessionobject - Throws:
AccessDeniedException- if the current user does not have the privilege to create this sessionjava.sql.SQLException- if a JDBC exception happensInvalidXSUserException- if an invalid XS user is specifiedXSException- if a generic error is detectedInvalidXSNamespaceException- if an invalid namespace is specifiedInvalidSessionException
-
attachSession
public abstract void attachSession(java.sql.Connection conn, Session session, java.util.Collection<java.lang.String> enabledDynamicRoles, java.util.Collection<java.lang.String> disabledDynamicRoles, java.util.Collection<ExternalRole> externalRoles, java.util.Collection<NamespaceValue> namespaceValues, java.sql.Timestamp authenticationTime) throws java.sql.SQLException, AccessDeniedException, InvalidSessionException, XSException, InvalidXSNamespaceExceptionAttaches the JDBC connection to the specified XS user's session. At same time,changes the dynamic roles, namespaces, and authentication time on the session.- Parameters:
conn- database connection to be used to attach to the sessionsession- the session object that needs to be attachedenabledDynamicRoles- a collection of dynamic role names to be enableddisabledDynamicRoles- a collection of dynamic role names to be disabledexternalRoles- a collection ofExternalRolesto be enablednamespaceValues- a list ofNamespaceAttributeValueobjects to be createdauthenticationTime- the authenticateion time- Throws:
AccessDeniedException- the current user does not have the privilege to attach to this sessionXSException- a generic error is detectedjava.sql.SQLException- a JDBC exception is thrownInvalidSessionException- an attempt is made to reference an invalid sessionInvalidXSNamespaceException- if an invalid namespace is specified- See Also:
Session,oracle.security.xs.NamespaceAttributeValue
-
attachSession
public abstract void attachSession(java.sql.Connection conn, Session session, java.util.Collection<java.lang.String> enabledDynamicRoles, java.util.Collection<java.lang.String> disabledDynamicRoles, java.util.Collection<NamespaceValue> namespaceValues, java.sql.Timestamp authenticationTime) throws java.sql.SQLException, AccessDeniedException, InvalidSessionException, XSException, InvalidXSNamespaceExceptionAttaches the JDBC connection to the specified XS user's session. At same time, changes the dynamic roles and namespaces on the session.- Parameters:
conn- database connection to be used to attach to the sessionsession- the session object that needs to be attachedenabledDynamicRoles- a collection of dynamic role names to be enableddisabledDynamicRoles- a collection of dynamic role names to be disablednamespaceValues- a list ofNamespaceAttributeValueobjects to be createdauthenticationTime- the authenticateion time- Throws:
AccessDeniedException- the current user does not have the privilege to attach to this sessionXSException- a generic error is detectedjava.sql.SQLException- a JDBC exception is thrownInvalidSessionException- an attempt is made to reference an invalid sessionInvalidXSNamespaceException- if an invalid namespace is specified- See Also:
Session,oracle.security.xs.NamespaceAttributeValue
-
detachSession
public abstract void detachSession(Session session) throws java.sql.SQLException, NotAttachedException, XSException
Detaches this session. Commits all the changes. A database round trip is required to perform this operation.- Throws:
java.sql.SQLException- a JDBC exception is thrownXSException- a generic error is detectedNotAttachedException- session not attached
-
abortSession
public abstract void abortSession(Session session) throws java.sql.SQLException, NotAttachedException, XSException
Detaches this session. Rollback all the changes. A database round trip is required to perform this operation.- Throws:
java.sql.SQLException- a JDBC exception is thrownXSException- a generic error is detectedNotAttachedException- session not attached
-
destroySession
public abstract void destroySession(java.sql.Connection conn, Session session) throws java.sql.SQLException, XSException, AccessDeniedException, InvalidSessionExceptionDestroys the XS session. The destroyed session may no longer be accessed from any JVM. A database round trip is required to perform this operation.- Parameters:
conn- the JDBC Connection used to make a roundtrip operation to the server and destroy the session- Throws:
AccessDeniedException- the current user does not have the privilege to destroyXSException- a generic error is detectedjava.sql.SQLException- a JDBC exception is thrownInvalidSessionException- an attempt is made to reference an invalid session
-
assignUser
public abstract void assignUser(Session session, java.lang.String targetUser, java.util.Collection<java.lang.String> enabledDynamicRoles, java.util.Collection<java.lang.String> disabledDynamicRoles, java.util.Collection<NamespaceValue> namespaceValues, java.sql.Timestamp authenticationTime) throws java.sql.SQLException, AccessDeniedException, InvalidSessionException, XSException, InvalidXSNamespaceException
Assigns an XS user to the session that was previously created for anonymous user. At same time, changes the dynamic roles, namespaces, and authentication time on the session.- Parameters:
session- Session obejct to assign user ontargetUser- a user initialized based on authenticationenabledDynamicRoles- a list of dynamic role names to be enableddisabledDynamicRoles- a list of dynamic role names to be disablednamespaceValues- a list ofNamespaceValueobjects to be created.authenticationTime- a timestamp indicated if the user authenticated- Throws:
AccessDeniedException- the current user does not have the privilege to switchuserXSException- a generic error is detectedjava.sql.SQLException- a JDBC exception is thrownInvalidSessionException- an attempt is made to reference an invalid sessionInvalidXSUserException- an invalid XS user is specifiedNotAttachedException- session not attachedInvalidXSNamespaceException- if an invalid namespace is specified
-
assignUser
public abstract void assignUser(Session session, ExternalUser targetUser, java.util.Collection<java.lang.String> enabledDynamicRoles, java.util.Collection<java.lang.String> disabledDynamicRoles, java.util.Collection<ExternalRole> externalRoles, java.util.Collection<NamespaceValue> namespaceValues, java.sql.Timestamp authenticationTime) throws java.sql.SQLException, AccessDeniedException, InvalidSessionException, XSException, InvalidXSNamespaceException
Assigns an external user to the session that was previously created for anonymous user. At same time, changes the dynamic roles, external roles, namespace, and authentication time on the session.- Parameters:
session- Session obejct to assign user ontargetUser- aUserobject initialized based on authenticationenabledDynamicRoles- a list of dynamic role names to be enableddisabledDynamicRoles- a list of dynamic role names to be disabledexternalRoles- a list of external roles to be grantednamespaceValues- a list ofNamespaceAttributeValueobjects to be created.authenticationTime- a timestamp indicated if the user authenticated- Throws:
AccessDeniedException- the current user does not have the privilege to switchuserXSException- a generic error is detectedjava.sql.SQLException- a JDBC exception is thrownInvalidSessionException- an attempt is made to reference an invalid sessionInvalidXSUserException- an invalid XS user is specifiedNotAttachedException- session not attachedInvalidXSNamespaceException- if an invalid namespace is specified
-
clearCache
public abstract void clearCache() throws java.security.AccessControlException, XSSessionManagerExceptionExplicitly clears the shared cache from the middle tier.- Throws:
java.security.AccessControlException- if security manager is enabled and clearCacheXSSecurityPermissionis not grantedXSSecurityManagerException-XSSecurityManageris not initializedXSSessionManagerException
-
getSessionManager
public static XSSessionManager getSessionManager(javax.sql.DataSource datasource, int cacheMaxIdleTime, int cacheMaxsize) throws XSException, java.security.NoSuchAlgorithmException, java.security.InvalidAlgorithmParameterException, java.security.spec.InvalidKeySpecException, java.security.InvalidKeyException, java.sql.SQLException
Initializes anXSSessionManagerusing connections from the connection pool. By default, the initialized XSSessionManager will sign the request. So the given connection pool user will be used to authorize the session operations. The caller of this method needs to have initSecurityManagerXSSecurityPermissionif security manager is enabled.- Parameters:
datasource- the connection poolDateSourcefor the database connectioncacheMaxIdleTime- maximum amount of time that the cache persists, in minutes, before synchronizing with the servercacheMaxsize- maximum allowable size, in bytes, of theACLorSecurityClasscache- Throws:
XSException- a generic error is detectedjava.security.NoSuchAlgorithmException- a particular cryptographic algorithm is requested but is not available in the environmentjava.security.InvalidAlgorithmParameterException- invalid or inappropriate algorithm parametersjava.security.spec.InvalidKeySpecException- invalid key specificationsjava.security.InvalidKeyException- invalid Keysjava.sql.SQLException- a problem in the SQL
-
getSessionManager
public static XSSessionManager getSessionManager(java.sql.Connection conn, int cacheMaxIdleTime, int cacheMaxsize) throws XSException, java.security.NoSuchAlgorithmException, java.security.InvalidAlgorithmParameterException, java.security.spec.InvalidKeySpecException, java.security.InvalidKeyException, java.sql.SQLException
Initializes anXSSessionManagerusing a dedicated connections. By default, the initialized XSSessionManager will sign the request. So the given connection will be used to authorize the session operations. The caller of this method needs to have initSecurityManagerXSSecurityPermissionif security manager is enabled.- Parameters:
conn- decicated JDBC connectioncacheMaxIdleTime- maximum amount of time that the cache persists, in minutes, before synchronizing with the servercacheMaxsize- maximum allowable size, in bytes, of theACLorSecurityClasscache- Throws:
XSException- a generic error is detectedjava.security.NoSuchAlgorithmException- a particular cryptographic algorithm is requested but is not available in the environmentjava.security.InvalidAlgorithmParameterException- invalid or inappropriate algorithm parametersjava.security.spec.InvalidKeySpecException- invalid key specificationsjava.security.InvalidKeyException- invalid Keysjava.sql.SQLException- a problem in the SQL
-
getCacheMaxIdleTime
public abstract int getCacheMaxIdleTime() throws XSSessionManagerExceptionReturns the maximum number of minutes for which the cache can remain without any activity- Returns:
- maximum number of minutes for which the cache can remain without any activity
- Throws:
XSSecurityManagerException-XSSecurityManageris not initializedXSSessionManagerException
-
setCacheMaxIdleTime
public abstract void setCacheMaxIdleTime(int minutes) throws java.security.AccessControlException, XSSessionManagerExceptionSets the maximum number of minutes for which the cache can remain without any activity. The caller of this method needs to have setCacheMaxIdleTimeXSSecurityPermissionif security manager is enabled.- Parameters:
minutes- the maximum number of minutes for which the cache can remain without any activity- Throws:
java.security.AccessControlException- if missing required permissionXSSecurityManagerException- ifXSSecurityManageris not initializedXSSessionManagerException
-
getCacheMaxSize
public abstract long getCacheMaxSize() throws XSSessionManagerExceptionReturns the maximum cache size, in bytes.- Returns:
- maximum cache size, in bytes
- Throws:
XSSecurityManagerException- ifXSSecurityManageris not initializedXSSessionManagerException
-
setCacheMaxSize
public abstract void setCacheMaxSize(long megaBytes) throws java.security.AccessControlException, XSSessionManagerExceptionSets the size of the cache on the middle tier, in bytes. The default value is 10MB and the minimum value is 1MB. The caller of this method needs to have setCacheSizeXSSecurityPermissionif security manager is enabled.- Parameters:
megaBytes- integer value representing cache in bytes- Throws:
java.security.AccessControlException- if missing required permissionXSSecurityManagerException- ifXSSecurityManageris not initialized.XSSessionManagerException
-
getHighWaterMark
public abstract float getHighWaterMark() throws XSSessionManagerExceptionGets the high watermark for the cache. if the cache size reaches high watermark the cache eviction algorithm removes entries until the cache size reaches low watermark.- Throws:
XSSecurityManagerException- ifXSSecurityManageris not initializedXSSessionManagerException
-
getLowWaterMark
public abstract float getLowWaterMark() throws XSSessionManagerExceptionGets the low watermark for the cache. if the cache size reaches high watermark the cache eviction algorithm removes entries until the cache size reaches low watermark.- Throws:
XSSecurityManagerException- ifXSSecurityManageris not initializedXSSessionManagerException
-
setWaterMark
public abstract void setWaterMark(float low, float high) throws java.security.AccessControlException, XSSessionManagerExceptionSets the high and low watermarks for the cache. The high watermark value must be in the range of 0.0 to 1.0, and the low watermark value must be lower then the high watermark value. The caller of this method needs to have setWaterMarkXSSecurityPermissionif security manager is enabled.- Parameters:
low- low watermark valuehigh- high watermark value- Throws:
java.security.AccessControlException- if missing required permissionXSSecurityManagerException- ifXSSecurityManageris not initializedXSSessionManagerException
-
getPrivateCacheMaxEntries
public abstract int getPrivateCacheMaxEntries()
Returns the maximum number of entries that the ACL evaluation result can be cached in the session.
-
setPrivateCacheMaxEntries
public abstract void setPrivateCacheMaxEntries(int maxEntries) throws java.security.AccessControlException, XSSessionManagerExceptionSets the maximum number of entries that the ACL evaluation result can be cached in the session. The caller of this method needs to have setPrivateCacheMaxEntriesXSSecurityPermissionif security manager is enabled.- Parameters:
maxEntries- number of cache entries- Throws:
java.security.AccessControlExceptionXSSessionManagerException
-
setCookie
public abstract void setCookie(Session session, java.lang.String cookie) throws XSException
Sets the cookie for the session- Parameters:
session- the session to be setcookie- value of the cookie- Throws:
XSException- a generic error is detected
-
setInactivityTimeout
public abstract void setInactivityTimeout(Session session, int minutes) throws XSException
Sets the inactivity timeout for the session in minutes.- Parameters:
session- the session to be setminutes- number in minutes- Throws:
XSException- a generic error is detected
-
createNamespace
public abstract SessionNamespace createNamespace(Session session, java.lang.String name) throws java.sql.SQLException, AccessDeniedException, XSException, InvalidXSNamespaceException, InvalidSessionException, NotAttachedException
Creates a new namespace for the given session. The createNamespace method creates a new session namespace using the namespace template document, whose name matches with the specified name. If an event handler is defined in the template document, then the defined event handler applies to all the namespaces created using that template. The dispatcher needs to have the privilege for the given namesapce.- Parameters:
session- the given sessionname- the name of the session namespace.- Returns:
SessionNamespacethat is created- Throws:
AccessDeniedException- the dispatcher does not have the privilege to create the namespaceXSException- a generic error is detectedjava.sql.SQLException- a JDBC exception is thrownInvalidXSNamespaceException- namespace already existsInvalidSessionException- an attempt is made to reference an invalid sessionNotAttachedException- session not attached
-
deleteNamespace
public abstract void deleteNamespace(Session session, java.lang.String namespace) throws java.sql.SQLException, AccessDeniedException, XSException, InvalidXSNamespaceException, InvalidSessionException, NotAttachedException
Removes a namespace from the session. The dispatcher needs to have the privilege for the given namesapce.- Parameters:
session- the given sessionnamespace- the namespace to be removed- Throws:
AccessDeniedException- the dispatcher does not have the privilege to delete this namespacejava.sql.SQLException- a JDBC exception is thrownInvalidXSNamespaceException- namespace is invalidInvalidSessionException- attempted to reference an invalid sessionNotAttachedException- session not attachedXSException- a generic error is detected
-
createAttribute
public abstract SessionNamespaceAttribute createAttribute(SessionNamespace sessionNS, java.lang.String name, java.lang.String value, java.util.List<SessionNamespace.ATTR_EVENT_TYPE> event) throws java.sql.SQLException, SessionNamespaceException, AccessDeniedException, XSException, InvalidXSAttributeException, NotAttachedException
Creates a new attribute in the namespace with the specified name, value, and event. The dispatcher needs to have the privilege for the given namesapce and attribute- Parameters:
sessionNS- the givenSessionNamespacename- name of the attributevalue- value of the attributeevent- event registration of the attribute- Returns:
- the newly created attribute
- Throws:
java.sql.SQLException- when a JDBC exception is thrownAccessDeniedException- when the dispatcher does not have the privilegeXSException- when a generic error is detectedSessionNamespaceException- when the attibute name is invalidInvalidXSAttributeException- when the attribute value is invalidNotAttachedException- when the session is not attached
-
deleteAttribute
public abstract void deleteAttribute(SessionNamespace sessionNS, java.lang.String name) throws java.sql.SQLException, AccessDeniedException, XSException, InvalidXSAttributeException, NotAttachedException
Deletes the specified attribute The dispatcher needs to have the privilege to delete the given attribute- Parameters:
sessionNS- the givenSessionNamespacename- name of the attribute- Throws:
java.sql.SQLException- when a JDBC exception is thrownAccessDeniedException- when the dispatcher user does not have the privilege to delete the attributeXSException- when a generic error is detectedInvalidXSAttributeException- when the attribute is invalidNotAttachedException- when the session is not attached
-
resetAttribute
public abstract SessionNamespaceAttribute resetAttribute(SessionNamespace sessionNS, java.lang.String name) throws java.sql.SQLException, AccessDeniedException, XSException, InvalidXSAttributeException, NotAttachedException
Resets the specified attribute in the namespace to its default value. The dispatcher needs to have the privilege to restet the namespace- Parameters:
sessionNS- the givenSessionNamespacename- name of the attribute- Returns:
- the attribute that has been reset
- Throws:
java.sql.SQLException- when a JDBC exception is thrownAccessDeniedException- when the current user does not have the privilege to reset the attributeXSException- when a generic error is detectedInvalidXSAttributeException- when the attribute is invalidNotAttachedException- when the session is not attached
-
setAttribute
public abstract SessionNamespaceAttribute setAttribute(SessionNamespace sessionNS, java.lang.String name, java.lang.String value) throws java.sql.SQLException, SessionNamespaceException, AccessDeniedException, XSException, InvalidXSAttributeException, NotAttachedException
Sets the attribute for a session namespace with the specified name and value The dispatcher needs to have the privilege to set the attribute on the given namespace- Parameters:
sessionNS- the givenSessionNamespacename- name of the attributevalue- value of the attribute- Returns:
- SessionNamespaceAttribute attribute object whose value is set
- Throws:
java.sql.SQLException- when a JDBC exception is thrownAccessDeniedException- when the dispatcher does not have the privilege to set the attribute on the namespace/attributeXSException- when a generic error is detectedSessionNamespaceException- when the namespace is invalidInvalidXSAttributeException- when the attribute is invalidNotAttachedException- when the session is not attached
-
-