Class DefaultSession
- java.lang.Object
-
- de.hybris.platform.servicelayer.session.impl.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 booleanequals(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> TgetAttribute(java.lang.String name)Returns for the given session attribute name the valueJaloSessiongetJaloSession()java.lang.StringgetSessionId()inthashCode()Returns the hashcode of this Session determined by it's session id.voidinit(JaloSession jaloSession, ModelService modelService)voidremoveAttribute(java.lang.String name)Removes the given attribute from the current session.voidsetAttribute(java.lang.String name, java.lang.Object value)Sets the given value Object to the Session as attribute with the given namevoidsetJaloSession(JaloSession jaloSession)Deprecated, for removal: This API element is subject to removal in a future version.since ages
-
-
-
Method Detail
-
setAttribute
public void setAttribute(java.lang.String name, java.lang.Object value)Description copied from interface:SessionSets the given value Object to the Session as attribute with the given name- Specified by:
setAttributein interfaceSession- Parameters:
name- the name of the attributevalue- the value to be set
-
getAttribute
public <T> T getAttribute(java.lang.String name)
Description copied from interface:SessionReturns for the given session attribute name the value- Specified by:
getAttributein interfaceSession- Parameters:
name- the attribute name- Returns:
nullif no attribute with the given name is stored in the session
-
getAllAttributes
public <T> java.util.Map<java.lang.String,T> getAllAttributes()
- Specified by:
getAllAttributesin interfaceSession- Returns:
- a Map with all session attributes
-
getSessionId
public java.lang.String getSessionId()
- Specified by:
getSessionIdin interfaceSession- 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(java.lang.Object object)
Checks whether given object equals this session by comparing session id's.- Overrides:
equalsin classjava.lang.Object
-
hashCode
public final int hashCode()
Returns the hashcode of this Session determined by it's session id.- Overrides:
hashCodein classjava.lang.Object
-
removeAttribute
public void removeAttribute(java.lang.String name)
Description copied from interface:SessionRemoves the given attribute from the current session. Do nothing if the attribute doesn't exists in the session.- Specified by:
removeAttributein interfaceSession- Parameters:
name- the attribute name
-
-