Class MCRSession

  • All Implemented Interfaces:

    public class MCRSession
    extends Object
    implements Cloneable
    Instances of this class collect information kept during a session like the currently active user, the preferred language etc.
    $Revision$ $Date$
    Detlev Degenhardt, Jens Kupferschmidt, Frank L├╝tzenkirchen
    • Method Detail

      • setLoginTime

        protected final void setLoginTime()
      • getID

        public String getID()
        Returns the unique ID of this session
      • getObjectsKeyList

        public Iterator<Object> 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 use getMapEntries() instead.
        Returns a list of all stored object keys within MCRSession as java.util.Ierator
      • getMapEntries

        public List<Map.Entry<Object,​Object>> getMapEntries()
        Returns an unmodifiable list of all entries in this MCRSession This method is thread safe.
      • getCurrentLanguage

        public final String getCurrentLanguage()
        returns the current language
      • setCurrentLanguage

        public final void setCurrentLanguage​(String language)
        sets the current language
      • getLocale

        public Locale getLocale()
      • debug

        public final void debug()
        Write data to the logger for debugging purposes
      • put

        public Object put​(Object key,
                          Object value)
        Stores an object under the given key within the session *
      • get

        public Object get​(Object key)
        Returns the object that was stored in the session under the given key *
      • deleteObject

        public void deleteObject​(Object key)
      • getCurrentIP

        public String getCurrentIP()
        Get the current ip value
      • setCurrentIP

        public final void setCurrentIP​(String newip)
        Set the ip to the given IP
      • getLoginTime

        public final long getLoginTime()
      • close

        public void close()
      • getLastAccessedTime

        public long getLastAccessedTime()
      • setFirstURI

        public void setFirstURI​(Supplier<URI> uri)
      • getThisAccessTime

        public long getThisAccessTime()
      • getCreateTime

        public long getCreateTime()
      • beginTransaction

        public void beginTransaction()
        starts a new database transaction.
      • transactionRequiresRollback

        public boolean transactionRequiresRollback()
        Determine whether the current resource transaction has been marked for rollback.
        boolean indicating whether the transaction has been marked for rollback
      • commitTransaction

        public void commitTransaction()
        commits the database transaction. Commit is only done if isTransactionActive() returns true.
      • rollbackTransaction

        public void rollbackTransaction()
        forces the database transaction to roll back. Roll back is only performed if isTransactionActive() returns true.
      • isTransactionActive

        public boolean isTransactionActive()
        Is the transaction still alive?
        true if the transaction is still alive
      • getUserInformation

        public MCRUserInformation getUserInformation()
        the userInformation
      • setUserInformation

        public void setUserInformation​(MCRUserInformation userSystemAdapter)
        userSystemAdapter - the userInformation to set
        IllegalArgumentException - if transition to new user information is forbidden (privilege escalation)
      • onCommit

        public void onCommit​(Runnable task)
        Add a task which will be executed after commitTransaction() was called.
        task - thread witch will be executed after an commit
      • submitOnCommitTasks

        protected void submitOnCommitTasks()