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.Session
public void setAttribute(java.lang.String attributeName, java.lang.Object attributeValue)
setAttribute
in interface org.springframework.session.Session
public <T> T getAttribute(java.lang.String attributeName)
getAttribute
in interface org.springframework.session.Session
public <T> T getAttributeOrDefault(java.lang.String name, T defaultValue)
getAttributeOrDefault
in interface org.springframework.session.Session
public <T> T getRequiredAttribute(java.lang.String name)
getRequiredAttribute
in interface org.springframework.session.Session
public java.util.Set<java.lang.String> getAttributeNames()
getAttributeNames
in interface org.springframework.session.Session
public boolean isExpired()
isExpired
in interface org.springframework.session.Session
public java.time.Instant getCreationTime()
getCreationTime
in interface org.springframework.session.Session
public void setLastAccessedTime(java.time.Instant lastAccessedTime)
setLastAccessedTime
in interface org.springframework.session.Session
public java.time.Instant getLastAccessedTime()
getLastAccessedTime
in interface org.springframework.session.Session
public void setMaxInactiveInterval(java.time.Duration interval)
setMaxInactiveInterval
in interface org.springframework.session.Session
public java.time.Duration getMaxInactiveInterval()
getMaxInactiveInterval
in interface org.springframework.session.Session
public java.lang.String changeSessionId()
changeSessionId
in interface org.springframework.session.Session
public void removeAttribute(java.lang.String attributeName)
removeAttribute
in interface org.springframework.session.Session