Class DefaultSession

java.lang.Object
de.hybris.platform.servicelayer.session.impl.DefaultSession
All Implemented Interfaces:
Session, Serializable
Direct Known Subclasses:
MockSession

public class DefaultSession extends Object implements Session, Serializable
Default implementation of the session interface.
Since:
4.0
See Also:
  • Constructor Details

    • DefaultSession

      public DefaultSession()
  • Method Details

    • setAttribute

      public void setAttribute(String name, 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(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> Map<String,T> getAllAttributes()
      Specified by:
      getAllAttributes in interface Session
      Returns:
      a Map with all session attributes
    • getSessionId

      public 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
    • init

      public void init(JaloSession jaloSession, ModelService modelService)
    • getJaloSession

      public JaloSession getJaloSession()
      Returns:
      the JaloSession
    • equals

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

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

      public void removeAttribute(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