Class DefaultSession

  • All Implemented Interfaces:
    Session, java.io.Serializable
    Direct Known Subclasses:
    MockSession

    public class DefaultSession
    extends java.lang.Object
    implements Session, java.io.Serializable
    Default implementation of the session interface.
    Since:
    4.0
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      DefaultSession()  
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object object)
      Checks whether given object equals this session by comparing session id's.
      <T> java.util.Map<java.lang.String,​T> getAllAttributes()  
      <T> T getAttribute​(java.lang.String name)
      Returns for the given session attribute name the value
      JaloSession getJaloSession()  
      java.lang.String getSessionId()  
      int hashCode()
      Returns the hashcode of this Session determined by it's session id.
      void init​(JaloSession jaloSession, ModelService modelService)  
      void removeAttribute​(java.lang.String name)
      Removes the given attribute from the current session.
      void setAttribute​(java.lang.String name, java.lang.Object value)
      Sets the given value Object to the Session as attribute with the given name
      void setJaloSession​(JaloSession jaloSession)
      Deprecated, for removal: This API element is subject to removal in a future version.
      since ages
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DefaultSession

        public DefaultSession()
    • Method Detail

      • setAttribute

        public void setAttribute​(java.lang.String name,
                                 java.lang.Object value)
        Description copied from interface: Session
        Sets the given value Object to the Session as attribute with the given name
        Specified by:
        setAttribute in interface Session
        Parameters:
        name - the name of the attribute
        value - the value to be set
      • getAttribute

        public <T> T getAttribute​(java.lang.String name)
        Description copied from interface: Session
        Returns for the given session attribute name the value
        Specified by:
        getAttribute in interface Session
        Parameters:
        name - the attribute name
        Returns:
        null if no attribute with the given name is stored in the session
      • getAllAttributes

        public <T> java.util.Map<java.lang.String,​T> getAllAttributes()
        Specified by:
        getAllAttributes in interface Session
        Returns:
        a Map with all session attributes
      • getSessionId

        public java.lang.String getSessionId()
        Specified by:
        getSessionId in interface Session
        Returns:
        the id of the session
      • setJaloSession

        @Deprecated(since="ages",
                    forRemoval=true)
        public void setJaloSession​(JaloSession jaloSession)
        Deprecated, for removal: This API element is subject to removal in a future version.
        since ages
      • equals

        public final boolean equals​(java.lang.Object object)
        Checks whether given object equals this session by comparing session id's.
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public final int hashCode()
        Returns the hashcode of this Session determined by it's session id.
        Overrides:
        hashCode in class java.lang.Object
      • removeAttribute

        public void removeAttribute​(java.lang.String name)
        Description copied from interface: Session
        Removes the given attribute from the current session. Do nothing if the attribute doesn't exists in the session.
        Specified by:
        removeAttribute in interface Session
        Parameters:
        name - the attribute name