public static class AbstractGemFireOperationsSessionRepository.GemFireSession<T extends AbstractGemFireOperationsSessionRepository.GemFireSessionAttributes>
extends java.lang.Object
implements java.lang.Comparable<org.springframework.session.Session>, org.springframework.session.Session
AbstractGemFireOperationsSessionRepository.GemFireSession is a Abstract Data Type (ADT) for a Spring Session that stores and manages
Session state in Apache Geode or Pivotal GemFire.Comparable,
Session,
AbstractGemFireOperationsSessionRepository.GemFireSessionAttributes| Modifier and Type | Field and Description |
|---|---|
protected static java.lang.String |
GEMFIRE_SESSION_TO_STRING |
protected static java.lang.String |
SPRING_SECURITY_CONTEXT |
| Modifier | Constructor and Description |
|---|---|
protected |
GemFireSession()
Constructs a new, default instance of
AbstractGemFireOperationsSessionRepository.GemFireSession initialized with
a generated Session Identifier. |
protected |
GemFireSession(org.springframework.session.Session session)
Constructs a new instance of
AbstractGemFireOperationsSessionRepository.GemFireSession copied from the given Session. |
protected |
GemFireSession(java.lang.String id)
Constructs a new instance of
AbstractGemFireOperationsSessionRepository.GemFireSession initialized with
the given Session Identifier. |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
changeSessionId()
Change the
identifier of this Session. |
protected void |
commit() |
int |
compareTo(org.springframework.session.Session session) |
AbstractGemFireOperationsSessionRepository.GemFireSession<T> |
configureWith(java.time.Duration maxInactiveInterval)
Builder method to configure the
max inactive interval before this AbstractGemFireOperationsSessionRepository.GemFireSession
will expire. |
AbstractGemFireOperationsSessionRepository.GemFireSession<T> |
configureWith(IsDirtyPredicate dirtyPredicate)
Builder method to configure the
IsDirtyPredicate strategy interface implementation to determine
whether users' application domain objects stored in this AbstractGemFireOperationsSessionRepository.GemFireSession are dirty. |
static AbstractGemFireOperationsSessionRepository.GemFireSession |
copy(org.springframework.session.Session session)
Copy (i.e.
|
static <T extends AbstractGemFireOperationsSessionRepository.GemFireSessionAttributes> |
create()
Factory method used to construct a new, default instance of
AbstractGemFireOperationsSessionRepository.GemFireSession. |
boolean |
equals(java.lang.Object obj) |
static AbstractGemFireOperationsSessionRepository.GemFireSession |
from(org.springframework.session.Session session)
Returns the given
Session if the Session is a AbstractGemFireOperationsSessionRepository.GemFireSession
or return a copy of the given Session as a AbstractGemFireOperationsSessionRepository.GemFireSession. |
<T> T |
getAttribute(java.lang.String attributeName) |
java.util.Set<java.lang.String> |
getAttributeNames() |
T |
getAttributes() |
java.time.Instant |
getCreationTime() |
java.lang.String |
getId() |
protected IsDirtyPredicate |
getIsDirtyPredicate() |
java.time.Instant |
getLastAccessedTime() |
java.time.Duration |
getMaxInactiveInterval() |
java.lang.String |
getPrincipalName() |
boolean |
hasDelta()
Determines whether this
AbstractGemFireOperationsSessionRepository.GemFireSession has any changes (i.e. |
int |
hashCode() |
boolean |
isExpired() |
protected T |
newSessionAttributes(java.lang.Object lock)
Constructs a new
AbstractGemFireOperationsSessionRepository.GemFireSessionAttributes object to store and manage Session attributes. |
void |
removeAttribute(java.lang.String attributeName) |
void |
setAttribute(java.lang.String attributeName,
java.lang.Object attributeValue) |
protected void |
setIsDirtyPredicate(IsDirtyPredicate dirtyPredicate) |
void |
setLastAccessedTime(java.time.Instant lastAccessedTime) |
void |
setMaxInactiveInterval(java.time.Duration maxInactiveInterval) |
void |
setPrincipalName(java.lang.String principalName) |
java.lang.String |
toString() |
protected void |
triggerDelta() |
protected void |
triggerDelta(boolean delta) |
protected static final java.lang.String GEMFIRE_SESSION_TO_STRING
protected static final java.lang.String SPRING_SECURITY_CONTEXT
protected GemFireSession()
AbstractGemFireOperationsSessionRepository.GemFireSession initialized with
a generated Session Identifier.GemFireSession(String),
generateSessionId()protected GemFireSession(java.lang.String id)
AbstractGemFireOperationsSessionRepository.GemFireSession initialized with
the given Session Identifier.
Additionally, the creationTime is set to Instant.now(), lastAccessedTime
is set to creationTime and the maxInactiveInterval is set to Duration.ZERO.id - String containing the unique identifier for this Session.validateSessionId(String)protected GemFireSession(org.springframework.session.Session session)
AbstractGemFireOperationsSessionRepository.GemFireSession copied from the given Session.session - Session to copy.java.lang.IllegalArgumentException - if Session is null.Sessionpublic static <T extends AbstractGemFireOperationsSessionRepository.GemFireSessionAttributes> AbstractGemFireOperationsSessionRepository.GemFireSession<T> create()
AbstractGemFireOperationsSessionRepository.GemFireSession.T - Sub-type of AbstractGemFireOperationsSessionRepository.GemFireSessionAttributes.AbstractGemFireOperationsSessionRepository.GemFireSession.AbstractGemFireOperationsSessionRepository.isUsingDataSerialization()public static AbstractGemFireOperationsSessionRepository.GemFireSession copy(@NonNull org.springframework.session.Session session)
Session.session - Session to copy/clone.AbstractGemFireOperationsSessionRepository.GemFireSession copied from the given Session.Session,
AbstractGemFireOperationsSessionRepository.isUsingDataSerialization()public static AbstractGemFireOperationsSessionRepository.GemFireSession from(@NonNull org.springframework.session.Session session)
Session if the Session is a AbstractGemFireOperationsSessionRepository.GemFireSession
or return a copy of the given Session as a AbstractGemFireOperationsSessionRepository.GemFireSession.session - Session to evaluate and possibly copy.Session if the Session is a AbstractGemFireOperationsSessionRepository.GemFireSession
or return a copy of the given Session as a AbstractGemFireOperationsSessionRepository.GemFireSession.copy(Session)protected T newSessionAttributes(java.lang.Object lock)
AbstractGemFireOperationsSessionRepository.GemFireSessionAttributes object to store and manage Session attributes.lock - Object used as the mutex for concurrent access and Thread-safety.AbstractGemFireOperationsSessionRepository.GemFireSessionAttributes.AbstractGemFireOperationsSessionRepository.GemFireSessionAttributes,
getIsDirtyPredicate()public java.lang.String changeSessionId()
identifier of this Session.changeSessionId in interface org.springframework.session.Sessionidentifier of of this Session.generateSessionId(),
triggerDelta(),
getId()protected void commit()
public boolean hasDelta()
AbstractGemFireOperationsSessionRepository.GemFireSession has any changes (i.e. a delta).
Changes exist if this GemFireSession's ID,
last accessed time, max inactive interval
or any of these attributes have changed.AbstractGemFireOperationsSessionRepository.GemFireSession has any changes.AbstractGemFireOperationsSessionRepository.GemFireSessionAttributes.hasDelta(),
getAttributes()protected void triggerDelta()
protected void triggerDelta(boolean delta)
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 void removeAttribute(java.lang.String attributeName)
removeAttribute in interface org.springframework.session.Sessionpublic <T> T getAttribute(java.lang.String attributeName)
getAttribute in interface org.springframework.session.Sessionpublic java.util.Set<java.lang.String> getAttributeNames()
getAttributeNames in interface org.springframework.session.Sessionpublic T getAttributes()
public java.time.Instant getCreationTime()
getCreationTime in interface org.springframework.session.Sessionpublic boolean isExpired()
isExpired in interface org.springframework.session.Sessionprotected void setIsDirtyPredicate(IsDirtyPredicate dirtyPredicate)
protected IsDirtyPredicate getIsDirtyPredicate()
public 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 maxInactiveInterval)
setMaxInactiveInterval in interface org.springframework.session.Sessionpublic java.time.Duration getMaxInactiveInterval()
getMaxInactiveInterval in interface org.springframework.session.Sessionpublic void setPrincipalName(java.lang.String principalName)
public java.lang.String getPrincipalName()
public AbstractGemFireOperationsSessionRepository.GemFireSession<T> configureWith(java.time.Duration maxInactiveInterval)
max inactive interval before this AbstractGemFireOperationsSessionRepository.GemFireSession
will expire.maxInactiveInterval - Duration specifying the maximum time this AbstractGemFireOperationsSessionRepository.GemFireSession
can remain inactive before expiration.AbstractGemFireOperationsSessionRepository.GemFireSession.setMaxInactiveInterval(Duration),
Durationpublic AbstractGemFireOperationsSessionRepository.GemFireSession<T> configureWith(IsDirtyPredicate dirtyPredicate)
IsDirtyPredicate strategy interface implementation to determine
whether users' application domain objects stored in this AbstractGemFireOperationsSessionRepository.GemFireSession are dirty.dirtyPredicate - IsDirtyPredicate strategy interface implementation that determines whether
the users' application domain objects stored in this AbstractGemFireOperationsSessionRepository.GemFireSession are dirty.AbstractGemFireOperationsSessionRepository.GemFireSession.IsDirtyPredicate,
setIsDirtyPredicate(IsDirtyPredicate)public int compareTo(org.springframework.session.Session session)
compareTo in interface java.lang.Comparable<org.springframework.session.Session>public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object