public interface IDfSessionManager
IDfSession
.IDfSession
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ALL_DOCBASES |
Modifier and Type | Method and Description |
---|---|
void |
abortTransaction()
Rolls back any repository activities on the repository since the transaction was started.
|
void |
authenticate(java.lang.String docbase)
Takes the repository name as an argument and throws an exception on bad user credentials.
|
void |
beginClientControl()
Deprecated.
No longer needed
|
void |
beginTransaction()
Starts a new "managed" transaction (repository transaction).
|
void |
clearIdentities()
Removes all provided identities for all repositories.
|
void |
clearIdentity(java.lang.String docbase)
Removes one single identity.
|
void |
commitTransaction()
Commits all changes to the repositories currently accessed.
|
void |
endClientControl()
Deprecated.
No longer needed
|
void |
flushSessions()
Flushes unused sessions from the session manager's pool.
|
IDfSessionManagerConfig |
getConfig()
Retrieves a IDfSessionManagerConfig object that contains configuration information pertaining to all sessions
managed by this session manager.
|
IDfLoginInfo |
getIdentity(java.lang.String docbase)
Retrieves a previously set identity for a given repository.
|
java.lang.String |
getLocale()
Returns the locale.
|
java.lang.String |
getPrincipalName()
Returns the principal name currently held in this session manager instance.
|
IDfScopeManager |
getScopeManager()
Returns an IDfScopeManager instance.
|
IDfSession |
getSession(java.lang.String docbase)
To get the session handle a service implementation should call the
getSession method. |
IDfSessionManagerStatistics |
getStatistics()
Retrieves a IDfSessionManagerStatistics object that contains diagnostics data.
|
boolean |
getTransactionRollbackOnly()
Method getTransactionRollbackOnly retrieves the rollback only flag.
|
boolean |
hasIdentity(java.lang.String docbase)
Checks whether an identity has been provided previously for a given repository.
|
boolean |
isTransactionActive()
Checks if a
beginTransaction has been started. |
IDfSession |
newSession(java.lang.String docbase)
To get a new instance of a DFC session,
newSession retrieves a new session for the given repository. |
void |
release(IDfSession session)
Puts the DFC session object back into the session pool.
|
void |
setIdentity(java.lang.String docbase,
IDfLoginInfo identity)
Sets the identity for "manual" user authentication.
|
IDfSessionManagerEventListener |
setListener(IDfSessionManagerEventListener listener)
Sets the event listener.
|
void |
setLocale(java.lang.String locale)
Method setLocale sets locale information that will be used for all sessions.
|
void |
setPrincipalName(java.lang.String name)
Sets the principal Name.
|
void |
setTransactionRollbackOnly()
Makes sure the managed transaction will be aborted in any case even if
commitTransaction method is
called outside of the service implementation. |
static final java.lang.String ALL_DOCBASES
void setPrincipalName(java.lang.String name)
name
- principal namejava.lang.String getPrincipalName()
void setLocale(java.lang.String locale)
locale
- java.lang.String getLocale()
void setIdentity(java.lang.String docbase, IDfLoginInfo identity) throws DfServiceException
docbase
- repository nameidentity
- IDfLoginInfo object set to the user credentials for that repository, like user name and password.DfServiceException
- Identity for this repository is already set.IDfLoginInfo getIdentity(java.lang.String docbase)
docbase
- repository nameboolean hasIdentity(java.lang.String docbase)
docbase
- repository namevoid clearIdentity(java.lang.String docbase)
docbase
- repository name for identity to be removedvoid clearIdentities()
void flushSessions()
void authenticate(java.lang.String docbase) throws DfIdentityException, DfAuthenticationException, DfPrincipalException, DfServiceException
docbase
- repository nameDfIdentityException
- Identity not properly definedDfAuthenticationException
- Bad user credentialsDfPrincipalException
- Principal session problemDfServiceException
- Cannot release sessionIDfSession getSession(java.lang.String docbase) throws DfIdentityException, DfAuthenticationException, DfPrincipalException, DfServiceException
getSession
method. The session
can be retrieved as many times as required. When the client is done the session must be released using the
release
method. If an IDfSession
has not been established for the the specified
repository, a new session is automatically created.docbase
- repository nameDfIdentityException
- Identity not properly defined (principal or identity for given repository).
getMessage() returns repository name.DfAuthenticationException
- Bad user credentialsDfPrincipalException
- Principal session problemDfServiceException
- Cannot release sessionIDfSession newSession(java.lang.String docbase) throws DfIdentityException, DfAuthenticationException, DfPrincipalException, DfServiceException
newSession
retrieves a new session for the given repository.
Again, a client is responsible for releasing this session after its use.docbase
- repository nameDfIdentityException
- Identity not properly defined (principal or identity for given repository).
getMessage() returns repository name.DfAuthenticationException
- Bad user credentialsDfPrincipalException
- Principal session problemDfServiceException
- Cannot release sessionvoid release(IDfSession session)
session
- DFC session objectvoid beginTransaction() throws DfServiceException
beginTransaction
is called but there is no repository session yet. In this case a flag is set
and when the first session is retrieved (using getSession
) the transaction is started.
Remember, that repository transactions depend on the underlying RDBMS transactions.
Only sessions obtain after the call to
beginTransaction
method will be able to participate in the transaction. Session objects obtain
before beginTransaction
will not be able to participate in the transaction.
Nested transactions
are not supported. You cannot begin a new transaction using either the beginTransaction
or
IDfSession.beginTrans
methods once either type of transaction is already started.
DfServiceException
- Internal problemsvoid commitTransaction() throws DfServiceException
This commit is ignored (and changed to an
abortTransaction
) if the setTransactionRollbackOnly
method has been called.
DfServiceException
- Internal problemsvoid abortTransaction() throws DfServiceException
DfServiceException
- Internal problemsboolean isTransactionActive()
beginTransaction
has been started. This method does not consider DFC unmanaged
transactions (beginTrans
) when determining if a transaction is active. It only applies to managed
transactions.void setTransactionRollbackOnly()
commitTransaction
method is
called outside of the service implementation. A special case is also when a service implementation decides to
abort the transaction but does not want to disturb the flow of the program. Basically this means to abort without
throwing an exception.boolean getTransactionRollbackOnly()
void beginClientControl()
endClientControl
method is called. Session pool locking is required for a scenario where a service returns a number of type based DFC object such as IDfPersistentObject.
After the processing returns,
the client must call the endClientControl
method to make sure the session pool is working again.
void endClientControl() throws DfServiceException
beginClientControl
); must be called in order to allow the session
manager to be able to pool the sessions again.DfServiceException
- Internal problemsIDfSessionManagerStatistics getStatistics()
IDfSessionManagerConfig getConfig()
IDfSessionManagerEventListener setListener(IDfSessionManagerEventListener listener)
listener
- the new listenerIDfScopeManager getScopeManager()
Copyright 1994-2023 OpenText Corporation. All rights reserved.