public class AbstractSession
extends java.lang.Object
implements org.springframework.session.Session
Session interface in order to simplify the implementation
of various Session types and their capabilities.Duration,
Instant,
Session| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
NOT_IMPLEMENTED |
| Constructor and Description |
|---|
AbstractSession() |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
changeSessionId() |
<T> T |
getAttribute(java.lang.String attributeName) |
java.util.Set<java.lang.String> |
getAttributeNames() |
<T> T |
getAttributeOrDefault(java.lang.String name,
T defaultValue) |
java.time.Instant |
getCreationTime() |
java.lang.String |
getId() |
java.time.Instant |
getLastAccessedTime() |
java.time.Duration |
getMaxInactiveInterval() |
<T> T |
getRequiredAttribute(java.lang.String name) |
boolean |
isExpired() |
void |
removeAttribute(java.lang.String attributeName) |
void |
setAttribute(java.lang.String attributeName,
java.lang.Object attributeValue) |
void |
setLastAccessedTime(java.time.Instant lastAccessedTime) |
void |
setMaxInactiveInterval(java.time.Duration interval) |
public static final java.lang.String NOT_IMPLEMENTED
public java.lang.String getId()
getId in interface org.springframework.session.Sessionpublic void setAttribute(java.lang.String attributeName,
java.lang.Object attributeValue)
setAttribute in interface org.springframework.session.Sessionpublic <T> T getAttribute(java.lang.String attributeName)
getAttribute in interface org.springframework.session.Sessionpublic <T> T getAttributeOrDefault(java.lang.String name,
T defaultValue)
getAttributeOrDefault in interface org.springframework.session.Sessionpublic <T> T getRequiredAttribute(java.lang.String name)
getRequiredAttribute in interface org.springframework.session.Sessionpublic java.util.Set<java.lang.String> getAttributeNames()
getAttributeNames in interface org.springframework.session.Sessionpublic boolean isExpired()
isExpired in interface org.springframework.session.Sessionpublic java.time.Instant getCreationTime()
getCreationTime in interface org.springframework.session.Sessionpublic void setLastAccessedTime(java.time.Instant lastAccessedTime)
setLastAccessedTime in interface org.springframework.session.Sessionpublic java.time.Instant getLastAccessedTime()
getLastAccessedTime in interface org.springframework.session.Sessionpublic void setMaxInactiveInterval(java.time.Duration interval)
setMaxInactiveInterval in interface org.springframework.session.Sessionpublic java.time.Duration getMaxInactiveInterval()
getMaxInactiveInterval in interface org.springframework.session.Sessionpublic java.lang.String changeSessionId()
changeSessionId in interface org.springframework.session.Sessionpublic void removeAttribute(java.lang.String attributeName)
removeAttribute in interface org.springframework.session.Session