| Constructor and Description |
|---|
MongoSession() |
MongoSession(long maxInactiveIntervalInSeconds) |
MongoSession(java.lang.String id,
long maxInactiveIntervalInSeconds) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
changeSessionId()
Changes the session id.
|
boolean |
equals(java.lang.Object o) |
<T> T |
getAttribute(java.lang.String attributeName)
Gets the Object associated with the specified name or null if no Object is
associated to that name.
|
java.util.Set<java.lang.String> |
getAttributeNames()
Gets the attribute names that have a value associated with it.
|
java.time.Instant |
getCreationTime()
Gets the time when this session was created.
|
java.util.Date |
getExpireAt() |
java.lang.String |
getId()
Gets a unique string that identifies the
Session. |
java.time.Instant |
getLastAccessedTime()
Gets the last time this
Session was accessed. |
java.time.Duration |
getMaxInactiveInterval()
Gets the maximum inactive interval between requests before this session will be
invalidated.
|
int |
hashCode() |
boolean |
isExpired()
Returns true if the session is expired.
|
void |
removeAttribute(java.lang.String attributeName)
Removes the attribute with the provided attribute name.
|
void |
setAttribute(java.lang.String attributeName,
java.lang.Object attributeValue)
Sets the attribute value for the provided attribute name.
|
void |
setCreationTime(long created) |
void |
setExpireAt(java.util.Date expireAt) |
void |
setLastAccessedTime(java.time.Instant lastAccessedTime)
Sets the last accessed time.
|
void |
setMaxInactiveInterval(java.time.Duration interval)
Sets the maximum inactive interval between requests before this session will be
invalidated.
|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitgetAttributeOrDefault, getRequiredAttributepublic MongoSession()
public MongoSession(long maxInactiveIntervalInSeconds)
public MongoSession(java.lang.String id,
long maxInactiveIntervalInSeconds)
public java.lang.String changeSessionId()
SessionSession.getId() will return a new
identifier.changeSessionId in interface SessionSession.getId() will now return@Nullable public <T> T getAttribute(java.lang.String attributeName)
SessiongetAttribute in interface SessionT - the return type of the attributeattributeName - the name of the attribute to getpublic java.util.Set<java.lang.String> getAttributeNames()
SessionSession.getAttribute(String) to
obtain the attribute value.getAttributeNames in interface SessionSession.getAttribute(String)public void setAttribute(java.lang.String attributeName,
java.lang.Object attributeValue)
SessionSession.removeAttribute(String) .setAttribute in interface SessionattributeName - the attribute name to setattributeValue - the value of the attribute to set. If null, the attribute
will be removed.public void removeAttribute(java.lang.String attributeName)
SessionremoveAttribute in interface SessionattributeName - the name of the attribute to removepublic java.time.Instant getCreationTime()
SessiongetCreationTime in interface Sessionpublic void setCreationTime(long created)
public java.time.Instant getLastAccessedTime()
SessionSession was accessed.getLastAccessedTime in interface Sessionpublic void setLastAccessedTime(java.time.Instant lastAccessedTime)
SessionsetLastAccessedTime in interface SessionlastAccessedTime - the last accessed timepublic java.time.Duration getMaxInactiveInterval()
SessiongetMaxInactiveInterval in interface Sessionpublic void setMaxInactiveInterval(java.time.Duration interval)
SessionsetMaxInactiveInterval in interface Sessioninterval - the amount of time that the Session should be kept alive
between client requests.public boolean isExpired()
Sessionpublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String getId()
SessionSession.public java.util.Date getExpireAt()
public void setExpireAt(java.util.Date expireAt)