Spring Session for VMware GemFire
Class AbstractGemFireOperationsSessionRepository.GemFireSession<T extends AbstractGemFireOperationsSessionRepository.GemFireSessionAttributes>
java.lang.Object
org.springframework.session.data.gemfire.AbstractGemFireOperationsSessionRepository.GemFireSession<T>
- All Implemented Interfaces:
Comparable<org.springframework.session.Session>,org.springframework.session.Session
- Direct Known Subclasses:
AbstractGemFireOperationsSessionRepository.DeltaCapableGemFireSession
- Enclosing class:
- AbstractGemFireOperationsSessionRepository
public static class AbstractGemFireOperationsSessionRepository.GemFireSession<T extends AbstractGemFireOperationsSessionRepository.GemFireSessionAttributes>
extends Object
implements 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.-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedConstructs a new, default instance ofAbstractGemFireOperationsSessionRepository.GemFireSessioninitialized with a generatedSession Identifier.protectedGemFireSession(String id) Constructs a new instance ofAbstractGemFireOperationsSessionRepository.GemFireSessioninitialized with the givenSession Identifier.protectedGemFireSession(org.springframework.session.Session session) Constructs a new instance ofAbstractGemFireOperationsSessionRepository.GemFireSessioncopied from the givenSession. -
Method Summary
Modifier and TypeMethodDescriptionChange theidentifierof thisSession.protected voidcommit()intcompareTo(org.springframework.session.Session session) configureWith(Duration maxInactiveInterval) Builder method to configure themax inactive intervalbefore thisAbstractGemFireOperationsSessionRepository.GemFireSessionwill expire.configureWith(IsDirtyPredicate dirtyPredicate) Builder method to configure theIsDirtyPredicatestrategy interface implementation to determine whether users'application domain objectsstored in thisAbstractGemFireOperationsSessionRepository.GemFireSessionare dirty.copy(org.springframework.session.Session session) Copy (i.e.static <T extends AbstractGemFireOperationsSessionRepository.GemFireSessionAttributes>
AbstractGemFireOperationsSessionRepository.GemFireSession<T>create()Factory method used to construct a new, default instance ofAbstractGemFireOperationsSessionRepository.GemFireSession.booleanfrom(org.springframework.session.Session session) Returns the givenSessionif theSessionis aAbstractGemFireOperationsSessionRepository.GemFireSessionor return a copy of the givenSessionas aAbstractGemFireOperationsSessionRepository.GemFireSession.<T> TgetAttribute(String attributeName) getId()protected IsDirtyPredicatebooleanhasDelta()Determines whether thisAbstractGemFireOperationsSessionRepository.GemFireSessionhas any changes (i.e.inthashCode()booleanprotected TnewSessionAttributes(Object lock) Constructs a newAbstractGemFireOperationsSessionRepository.GemFireSessionAttributesobject to store and manage Session attributes.voidremoveAttribute(String attributeName) voidsetAttribute(String attributeName, Object attributeValue) protected voidsetIsDirtyPredicate(IsDirtyPredicate dirtyPredicate) voidsetLastAccessedTime(Instant lastAccessedTime) voidsetMaxInactiveInterval(Duration maxInactiveInterval) voidsetPrincipalName(String principalName) toString()protected voidprotected voidtriggerDelta(boolean delta) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.springframework.session.Session
getAttributeOrDefault, getRequiredAttribute
-
Field Details
-
GEMFIRE_SESSION_TO_STRING
- See Also:
-
SPRING_SECURITY_CONTEXT
- See Also:
-
-
Constructor Details
-
GemFireSession
protected GemFireSession()Constructs a new, default instance ofAbstractGemFireOperationsSessionRepository.GemFireSessioninitialized with a generatedSession Identifier.- See Also:
-
GemFireSession(String)generateSessionId()
-
GemFireSession
Constructs a new instance ofAbstractGemFireOperationsSessionRepository.GemFireSessioninitialized with the givenSession Identifier. Additionally, thecreationTimeis set toInstant.now(),lastAccessedTimeis set tocreationTimeand themaxInactiveIntervalis set toDuration.ZERO.- Parameters:
id-Stringcontaining the unique identifier for thisSession.- See Also:
-
validateSessionId(String)
-
GemFireSession
protected GemFireSession(org.springframework.session.Session session) Constructs a new instance ofAbstractGemFireOperationsSessionRepository.GemFireSessioncopied from the givenSession.- Parameters:
session-Sessionto copy.- Throws:
IllegalArgumentException- ifSessionis null.- See Also:
-
Session
-
-
Method Details
-
create
public static <T extends AbstractGemFireOperationsSessionRepository.GemFireSessionAttributes> AbstractGemFireOperationsSessionRepository.GemFireSession<T> create()Factory method used to construct a new, default instance ofAbstractGemFireOperationsSessionRepository.GemFireSession.- Type Parameters:
T-Sub-typeofAbstractGemFireOperationsSessionRepository.GemFireSessionAttributes.- Returns:
- a new
AbstractGemFireOperationsSessionRepository.GemFireSession. - See Also:
-
copy
public static AbstractGemFireOperationsSessionRepository.GemFireSession copy(@NonNull org.springframework.session.Session session) Copy (i.e. clone) the givenSession.- Parameters:
session-Sessionto copy/clone.- Returns:
- a new instance of
AbstractGemFireOperationsSessionRepository.GemFireSessioncopied from the givenSession. - See Also:
-
from
public static AbstractGemFireOperationsSessionRepository.GemFireSession from(@NonNull org.springframework.session.Session session) Returns the givenSessionif theSessionis aAbstractGemFireOperationsSessionRepository.GemFireSessionor return a copy of the givenSessionas aAbstractGemFireOperationsSessionRepository.GemFireSession.- Parameters:
session-Sessionto evaluate and possibly copy.- Returns:
- the given
Sessionif theSessionis aAbstractGemFireOperationsSessionRepository.GemFireSessionor return a copy of the givenSessionas aAbstractGemFireOperationsSessionRepository.GemFireSession. - See Also:
-
newSessionAttributes
Constructs a newAbstractGemFireOperationsSessionRepository.GemFireSessionAttributesobject to store and manage Session attributes.- Parameters:
lock-Objectused as the mutex for concurrent access and Thread-safety.- Returns:
- the new
AbstractGemFireOperationsSessionRepository.GemFireSessionAttributes. - See Also:
-
changeSessionId
Change theidentifierof thisSession.- Specified by:
changeSessionIdin interfaceorg.springframework.session.Session- Returns:
- the new
identifierof of thisSession. - See Also:
-
generateSessionId()triggerDelta()getId()
-
commit
protected void commit() -
hasDelta
public boolean hasDelta()Determines whether thisAbstractGemFireOperationsSessionRepository.GemFireSessionhas any changes (i.e. a delta). Changes exist if thisGemFireSession'sID,last accessed time,max inactive intervalor any of theseattributeshave changed.- Returns:
- a boolean value indicating whether this
AbstractGemFireOperationsSessionRepository.GemFireSessionhas any changes. - See Also:
-
triggerDelta
protected void triggerDelta() -
triggerDelta
protected void triggerDelta(boolean delta) -
getId
- Specified by:
getIdin interfaceorg.springframework.session.Session
-
setAttribute
- Specified by:
setAttributein interfaceorg.springframework.session.Session
-
removeAttribute
- Specified by:
removeAttributein interfaceorg.springframework.session.Session
-
getAttribute
- Specified by:
getAttributein interfaceorg.springframework.session.Session
-
getAttributeNames
- Specified by:
getAttributeNamesin interfaceorg.springframework.session.Session
-
getAttributes
-
getCreationTime
- Specified by:
getCreationTimein interfaceorg.springframework.session.Session
-
isExpired
public boolean isExpired()- Specified by:
isExpiredin interfaceorg.springframework.session.Session
-
setIsDirtyPredicate
-
getIsDirtyPredicate
-
setLastAccessedTime
- Specified by:
setLastAccessedTimein interfaceorg.springframework.session.Session
-
getLastAccessedTime
- Specified by:
getLastAccessedTimein interfaceorg.springframework.session.Session
-
setMaxInactiveInterval
- Specified by:
setMaxInactiveIntervalin interfaceorg.springframework.session.Session
-
getMaxInactiveInterval
- Specified by:
getMaxInactiveIntervalin interfaceorg.springframework.session.Session
-
setPrincipalName
-
getPrincipalName
-
configureWith
public AbstractGemFireOperationsSessionRepository.GemFireSession<T> configureWith(Duration maxInactiveInterval) Builder method to configure themax inactive intervalbefore thisAbstractGemFireOperationsSessionRepository.GemFireSessionwill expire.- Parameters:
maxInactiveInterval-Durationspecifying the maximum time thisAbstractGemFireOperationsSessionRepository.GemFireSessioncan remain inactive before expiration.- Returns:
- this
AbstractGemFireOperationsSessionRepository.GemFireSession. - See Also:
-
configureWith
public AbstractGemFireOperationsSessionRepository.GemFireSession<T> configureWith(IsDirtyPredicate dirtyPredicate) Builder method to configure theIsDirtyPredicatestrategy interface implementation to determine whether users'application domain objectsstored in thisAbstractGemFireOperationsSessionRepository.GemFireSessionare dirty.- Parameters:
dirtyPredicate-IsDirtyPredicatestrategy interface implementation that determines whether the users'application domain objectsstored in thisAbstractGemFireOperationsSessionRepository.GemFireSessionare dirty.- Returns:
- this
AbstractGemFireOperationsSessionRepository.GemFireSession. - See Also:
-
compareTo
public int compareTo(org.springframework.session.Session session) - Specified by:
compareToin interfaceComparable<T extends AbstractGemFireOperationsSessionRepository.GemFireSessionAttributes>
-
equals
-
hashCode
public int hashCode() -
toString
-