Package org.mycore.common
Class MCRSession
java.lang.Object
org.mycore.common.MCRSession
- All Implemented Interfaces:
Cloneable
Instances of this class collect information kept during a session like the currently active user, the preferred
language etc.
- Version:
- $Revision$ $Date$
- Author:
- Detlev Degenhardt, Jens Kupferschmidt, Frank Lützenkirchen
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Deprecated.void
close()
void
Deprecated.final void
debug()
Write data to the logger for debugging purposesvoid
deleteObject
(Object key) Returns the object that was stored in the session under the given key *long
Get the current ip valuefinal String
returns the current languagegetID()
Returns the unique ID of this sessionlong
final long
Returns an unmodifiable list of all entries in this MCRSession This method is thread safe.Returns a list of all stored object keys within MCRSession.long
boolean
Deprecated.void
Add a task which will be executed aftercommitTransaction()
was called.Stores an object under the given key within the session *void
Deprecated.final void
setCurrentIP
(String newip) Set the ip to the given IPfinal void
setCurrentLanguage
(String language) sets the current languagevoid
setFirstURI
(Supplier<URI> uri) protected final void
void
setUserInformation
(MCRUserInformation userSystemAdapter) protected void
toString()
boolean
Deprecated.
-
Method Details
-
setLoginTime
protected final void setLoginTime() -
getID
Returns the unique ID of this session -
getObjectsKeyList
Returns a list of all stored object keys within MCRSession. This method is not thread safe. I you need thread safe access to all stored objects usegetMapEntries()
instead.- Returns:
- Returns a list of all stored object keys within MCRSession as java.util.Ierator
-
getMapEntries
Returns an unmodifiable list of all entries in this MCRSession This method is thread safe. -
getCurrentLanguage
returns the current language -
setCurrentLanguage
sets the current language -
getLocale
-
debug
public final void debug()Write data to the logger for debugging purposes -
put
Stores an object under the given key within the session * -
get
Returns the object that was stored in the session under the given key * -
deleteObject
-
getCurrentIP
Get the current ip value -
setCurrentIP
Set the ip to the given IP -
getLoginTime
public final long getLoginTime() -
close
public void close() -
toString
-
getLastAccessedTime
public long getLastAccessedTime() -
setFirstURI
-
getThisAccessTime
public long getThisAccessTime() -
getCreateTime
public long getCreateTime() -
beginTransaction
Deprecated.starts a new database transaction. -
transactionRequiresRollback
Deprecated.Determine whether the current resource transaction has been marked for rollback.- Returns:
- boolean indicating whether the transaction has been marked for rollback
-
commitTransaction
Deprecated.commits the database transaction. Commit is only done ifisTransactionActive()
returns true. -
rollbackTransaction
Deprecated.forces the database transaction to roll back. Roll back is only performed ifisTransactionActive()
returns true. -
isTransactionActive
Deprecated.Is the transaction still alive?- Returns:
- true if the transaction is still alive
-
getConstructingStackTrace
-
getFirstURI
-
getUserInformation
- Returns:
- the userInformation
-
setUserInformation
- Parameters:
userSystemAdapter
- the userInformation to set- Throws:
IllegalArgumentException
- if transition to new user information is forbidden (privilege escalation)
-
onCommit
Add a task which will be executed aftercommitTransaction()
was called.- Parameters:
task
- thread witch will be executed after an commit
-
submitOnCommitTasks
protected void submitOnCommitTasks()
-