Modifier and Type | Class and Description |
---|---|
class |
WGSessionContext.DocumentContext |
Modifier and Type | Field and Description |
---|---|
static org.apache.log4j.Logger |
LOG_COREFETCHING |
static org.apache.log4j.Logger |
LOG_SESSIONS |
static java.lang.String |
SATTRIB_BYPASS_PREEMTIVE_CACHING
Predefined attribute key to be placed via
setAttribute(Object, Object) on a session to control "preemptive caching" behaviour, which automatically caches some frequently used values from a just retrieved document. |
static int |
TRANSACTION_MODE_DEFAULT
The default transaction mode of this database backend.
|
static int |
TRANSACTION_MODE_MANUAL
Manual control of transaction commit by using
WGDatabase.startTransaction() |
Modifier and Type | Method and Description |
---|---|
void |
addAfterTransactionTask(java.util.concurrent.Callable<java.lang.Object> r) |
void |
addFetchedCore(WGDocument doc,
WGDocumentCore core)
Adds a fetched document core to the document cores list.
|
void |
clearCache()
Clears the session private cache including all fetched document cores.
|
int |
getAccessLevel()
The access level of the current user.
|
java.lang.Object |
getAttribute(java.lang.Object key)
Retrieves a custom attribute added to this session.
|
AuthenticationSession |
getAuthenticationSession()
Returns the session on the authentication module in use for this database session
|
java.lang.String |
getClient()
Returns the current client software which uses the WGAPI.
|
java.util.Date |
getCreated()
Returns the creation date of this session.
|
java.lang.Object |
getCredentials()
Returns the credentials object used to open this session
|
java.util.Date |
getDatabaseChangeDateAtStart()
Returns the last changed date that the opened database had at the beginning of this session
|
java.util.List<WGDocument> |
getEditedDocuments()
Returns a list of documents that were edited in the current session and have not yet been saved
|
java.lang.String |
getMasterTenantUser()
When this is a master session can hold the name of the user that triggered this master session
|
int |
getMaxDocs()
Returns the maximum number of backend documents that session may fetch at once.
|
WGUserAccess |
getOriginalUserAccess()
If an
UserAccessFilter is active on the session returns the original user access of the current user without the filter. |
java.lang.String |
getPassword()
The password used to open this session, if any
|
java.lang.Comparable<?> |
getRevisionAtStart()
Returns the database revision that was current when the session started
|
java.lang.String |
getSessionToken()
If the database supports feature WGDatabase.FEATURE_SESSIONTOKEN, a session token that can be used to reconnect to this database session after this WGA session has been closed.
|
java.lang.String |
getTask()
Returns the task the WGA client is executing in this session.
|
int |
getTotalFetchedCores()
Returns the total number of fetched cores in this session (without core reduction)
|
int |
getTransactionMode()
Returns the current transaction mode of the session of one of the constants WGSessionContext.TRANSACTION_MODE...
|
java.lang.String |
getUser()
The current users name.
|
WGUserAccess |
getUserAccess()
Returns the complete access rights information of current session
|
WGUserDetails |
getUserDetails()
Returns details about the current user if the DB implementation supports this, otherwise null.
|
boolean |
isActiveCore(WGDocumentCore core)
Checks ift the given document core is attached to the current session
|
boolean |
isAnonymous()
Determines, if this is an anonymous session
|
boolean |
isAnyDocumentEdited()
Determines if any document has been edited in the current session whose changes are not yet saved
|
boolean |
isBatchProcess()
Returns if the current session is marked as belonging to a batch process, processing mass data.
|
boolean |
isCacheWritingEnabled()
Returns if we currently may write to the cache.
|
boolean |
isCachingEnabled()
Determines, if caching is enabled for this session.
|
boolean |
isCascadeDeletions()
Determines, if cascaded deletions are active in this session (i.e. removing a parent document automatically removes it's children)
|
boolean |
isContentTypeEventsEnabled()
Returns if content type events are enabled for this session
|
boolean |
isDatabaseUpdated()
Determines, if this database has been updated since last session or inside this session.
|
boolean |
isDesigner()
Deprecated.
There are no multiple designer access levels any more. Directly test for access level "manager" instead.
|
boolean |
isEventsEnabled()
Determines, if events are enabled in this session
|
boolean |
isEventThread()
Determines if the current session runs in the WGAPI event thread
|
boolean |
isMasterSession()
Returns if this session is a master session (i.e. build with databases master login)
|
boolean |
isMaxCoreMessageShowed()
Determines, if the message that the maxdocs threshold has been exceeded, has already been put out to the log.
|
boolean |
isProtectedRelationsEnabled()
Returns if protection for protected relations is enabled.
|
boolean |
isTestUniqueNames()
Determines if unique content names are tested before saving content.
|
boolean |
isTransactionActive()
Determines if a (real) manual transaction is currently in process
|
void |
removeAttribute(java.lang.String name)
Removes a session attribute
|
void |
resetTransactionMode()
Sets the transaction mode back to the initial transaction mode of the session
|
void |
setAttribute(java.lang.Object key,
java.lang.Object value)
Sets a custom attribute to this session.
|
void |
setBatchProcess(boolean batchProcess)
Sets it this session is marked as belonging to a batch process.
|
void |
setCachingEnabled(boolean b)
Sets, if caching is enabled for this session.
|
void |
setCascadeDeletions(boolean b)
Sets if cascaded deletions (removing a parent document automatically removes it's children) should be enabled
|
void |
setClient(java.lang.String string)
Sets the WGA client software that is currently using the WGAPI.
|
void |
setContentTypeEventsEnabled(boolean contentTypeEventsEnabled)
Sets if content type events are enabled on this session
|
void |
setEventsEnabled(boolean b)
Sets if events should be enabled for this session
|
void |
setMasterTenantUser(java.lang.String masterTenantUser)
On master sessions can be used to set the name of the user that triggered the master session.
|
void |
setMaxDocs(int maxDocs)
Sets the maximum number of backend documents that the current session may fetch at once.
|
void |
setProtectedRelationsEnabled(boolean protectedRelationsEnabled)
Sets if protection for protected relations is enabled.
|
void |
setTask(java.lang.String string)
Sets the task that the current WGA client is accomplishing
|
void |
setTestUniqueNames(boolean b)
Sets if unique content names should be tested before storing content in this session
|
void |
setTransactionMode(int transactionMode)
Sets the transaction mode for this session.
|
public static final org.apache.log4j.Logger LOG_COREFETCHING
public static final org.apache.log4j.Logger LOG_SESSIONS
public static final java.lang.String SATTRIB_BYPASS_PREEMTIVE_CACHING
setAttribute(Object, Object)
on a session to control "preemptive caching" behaviour, which automatically caches some frequently used values from a just retrieved document.
This is enabled by default. Store this with attribute value "false" to disable it.public static final int TRANSACTION_MODE_DEFAULT
public static final int TRANSACTION_MODE_MANUAL
WGDatabase.startTransaction()
public void addFetchedCore(WGDocument doc, WGDocumentCore core)
doc
- public int getAccessLevel()
public WGUserAccess getUserAccess()
public java.lang.Object getAttribute(java.lang.Object key)
key
- Name of the attributepublic java.lang.String getPassword()
public java.lang.Object getCredentials()
public java.lang.String getSessionToken() throws WGBackendException
WGBackendException
public java.lang.String getUser()
public boolean isAnonymous()
public boolean isDatabaseUpdated()
public boolean isDesigner()
public boolean isTransactionActive()
public void setAttribute(java.lang.Object key, java.lang.Object value)
key
- The attribute namevalue
- The attribute valuepublic boolean isEventThread()
public boolean isMasterSession()
public boolean isEventsEnabled()
public void setEventsEnabled(boolean b)
b
- public WGUserDetails getUserDetails() throws WGAPIException
WGAPIException
public boolean isCascadeDeletions()
public void setCascadeDeletions(boolean b)
b
- public java.lang.String getClient()
public void setClient(java.lang.String string)
string
- A wga client string.public java.lang.String getTask()
public void setTask(java.lang.String string)
string
- public int getTotalFetchedCores()
public boolean isMaxCoreMessageShowed()
public boolean isAnyDocumentEdited()
public java.util.Date getCreated()
public boolean isCachingEnabled()
public boolean isCacheWritingEnabled()
public void setCachingEnabled(boolean b)
b
- public boolean isTestUniqueNames()
public void setTestUniqueNames(boolean b)
b
- public int getMaxDocs()
public void setMaxDocs(int maxDocs)
maxDocs
- The maxDocs to set.public boolean isBatchProcess()
public void setBatchProcess(boolean batchProcess)
public java.util.Date getDatabaseChangeDateAtStart()
public java.util.List<WGDocument> getEditedDocuments()
public AuthenticationSession getAuthenticationSession()
public void clearCache() throws WGAPIException
WGAPIException
public boolean isProtectedRelationsEnabled()
public void setProtectedRelationsEnabled(boolean protectedRelationsEnabled)
public boolean isContentTypeEventsEnabled()
public void setContentTypeEventsEnabled(boolean contentTypeEventsEnabled)
public void setTransactionMode(int transactionMode)
WGDatabase.startTransaction()
and the methods of the returned WGTransaction
objecttransactionMode
- The transaction mode. Use constants WGSessionContext.TRANSACTION_MODE...public int getTransactionMode()
public void resetTransactionMode()
public void removeAttribute(java.lang.String name)
name
- Then name of the attributepublic java.lang.Comparable<?> getRevisionAtStart()
public WGUserAccess getOriginalUserAccess()
UserAccessFilter
is active on the session returns the original user access of the current user without the filter. If no filter is active returns null.public java.lang.String getMasterTenantUser()
public void setMasterTenantUser(java.lang.String masterTenantUser) throws WGAPIException
masterTenantUser
- WGAPIException
public boolean isActiveCore(WGDocumentCore core) throws WGAPIException
WGAPIException
public void addAfterTransactionTask(java.util.concurrent.Callable<java.lang.Object> r)