Class MongoSession
java.lang.Object
org.springframework.session.data.mongo.MongoSession
- All Implemented Interfaces:
org.springframework.session.Session
Session object providing additional information about the datetime of expiration.
- Since:
- 1.2
-
Constructor Summary
ConstructorsConstructorDescriptionMongoSession(long maxInactiveIntervalInSeconds) MongoSession(String sessionId) Constructs a new instance using the provided session id.MongoSession(String id, long maxInactiveIntervalInSeconds) MongoSession(org.springframework.session.SessionIdGenerator sessionIdGenerator) Constructs a new instance using the providedSessionIdGenerator. -
Method Summary
Modifier and TypeMethodDescriptionboolean<T> TgetAttribute(String attributeName) getId()inthashCode()booleanvoidremoveAttribute(String attributeName) voidsetAttribute(String attributeName, Object attributeValue) voidsetLastAccessedTime(Instant lastAccessedTime) voidsetMaxInactiveInterval(Duration interval) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.session.Session
getAttributeOrDefault, getRequiredAttribute
-
Constructor Details
-
MongoSession
Constructs a new instance using the provided session id.- Parameters:
sessionId- the session id to use- Since:
- 3.2
-
MongoSession
public MongoSession() -
MongoSession
public MongoSession(long maxInactiveIntervalInSeconds) -
MongoSession
-
MongoSession
public MongoSession(org.springframework.session.SessionIdGenerator sessionIdGenerator) Constructs a new instance using the providedSessionIdGenerator.- Parameters:
sessionIdGenerator- theSessionIdGeneratorto use- Since:
- 3.2
-
-
Method Details
-
changeSessionId
- Specified by:
changeSessionIdin interfaceorg.springframework.session.Session
-
getAttribute
- Specified by:
getAttributein interfaceorg.springframework.session.Session
-
getAttributeNames
- Specified by:
getAttributeNamesin interfaceorg.springframework.session.Session
-
setAttribute
- Specified by:
setAttributein interfaceorg.springframework.session.Session
-
removeAttribute
- Specified by:
removeAttributein interfaceorg.springframework.session.Session
-
getCreationTime
- Specified by:
getCreationTimein interfaceorg.springframework.session.Session
-
getLastAccessedTime
- Specified by:
getLastAccessedTimein interfaceorg.springframework.session.Session
-
setLastAccessedTime
- Specified by:
setLastAccessedTimein interfaceorg.springframework.session.Session
-
getMaxInactiveInterval
- Specified by:
getMaxInactiveIntervalin interfaceorg.springframework.session.Session
-
setMaxInactiveInterval
- Specified by:
setMaxInactiveIntervalin interfaceorg.springframework.session.Session
-
isExpired
public boolean isExpired()- Specified by:
isExpiredin interfaceorg.springframework.session.Session
-
equals
-
hashCode
public int hashCode() -
getId
- Specified by:
getIdin interfaceorg.springframework.session.Session
-