Package org.spincast.plugins.session
Class SpincastSessionDefault
java.lang.Object
org.spincast.plugins.session.SpincastSessionDefault
- All Implemented Interfaces:
SpincastSession
-
Constructor Summary
ConstructorsConstructorDescriptionSpincastSessionDefault(String sessionId, Instant creationDate, Instant modificationDate, JsonObject attributes, boolean setAsDirty, boolean isNew, JsonManager jsonManager, SpincastSessionManager spincastSessionManager) SpincastSessionDefault(String sessionId, Instant creationDate, Instant modificationDate, JsonObject attributes, boolean setAsDirty, JsonManager jsonManager, SpincastSessionManager spincastSessionManager) SpincastSessionDefault(String sessionId, Instant creationDate, Instant modificationDate, JsonObject attributes, JsonManager jsonManager, SpincastSessionManager spincastSessionManager) SpincastSessionDefault(JsonManager jsonManager, SpincastSessionManager spincastSessionManager) Constructor for a *new* session. -
Method Summary
Modifier and TypeMethodDescriptionReturns a mutableJsonObjectrepresenting the attributes of the session.protected Stringprotected StringThe Instant at which the session was created.getId()The unique id of this session.protected JsonManagerThe Instant at which the session was modified for the last time.protected SpincastSessionManagervoidSets the session as "not valid anymore".booleanisDirty()Was the session modified since it was loaded?protected booleanbooleanHas the session been invalidated?booleanisNew()Returnstrueif the session has been created in the current request.voidsetDirty()This allows you to flag a session as being dirty, even if its attributes don't change.toString()
-
Constructor Details
-
SpincastSessionDefault
public SpincastSessionDefault(JsonManager jsonManager, SpincastSessionManager spincastSessionManager) Constructor for a *new* session. -
SpincastSessionDefault
public SpincastSessionDefault(String sessionId, Instant creationDate, Instant modificationDate, @Nullable JsonObject attributes, JsonManager jsonManager, SpincastSessionManager spincastSessionManager) -
SpincastSessionDefault
public SpincastSessionDefault(String sessionId, Instant creationDate, Instant modificationDate, @Nullable JsonObject attributes, boolean setAsDirty, JsonManager jsonManager, SpincastSessionManager spincastSessionManager) -
SpincastSessionDefault
public SpincastSessionDefault(String sessionId, Instant creationDate, Instant modificationDate, JsonObject attributes, boolean setAsDirty, boolean isNew, JsonManager jsonManager, SpincastSessionManager spincastSessionManager)
-
-
Method Details
-
getJsonManager
-
getSpincastSessionManager
-
getAttributesHash
-
getAttributesInitialHash
-
isForcedAsDirty
protected boolean isForcedAsDirty() -
getId
Description copied from interface:SpincastSessionThe unique id of this session.- Specified by:
getIdin interfaceSpincastSession
-
isNew
public boolean isNew()Description copied from interface:SpincastSessionReturnstrueif the session has been created in the current request.- Specified by:
isNewin interfaceSpincastSession
-
getAttributes
Description copied from interface:SpincastSessionReturns a mutableJsonObjectrepresenting the attributes of the session. You can use this object to get/retrieve/delete attributes.- Specified by:
getAttributesin interfaceSpincastSession
-
getCreationDate
Description copied from interface:SpincastSessionThe Instant at which the session was created.- Specified by:
getCreationDatein interfaceSpincastSession
-
getModificationDate
Description copied from interface:SpincastSessionThe Instant at which the session was modified for the last time.- Specified by:
getModificationDatein interfaceSpincastSession
-
isDirty
public boolean isDirty()Description copied from interface:SpincastSessionWas the session modified since it was loaded?- Specified by:
isDirtyin interfaceSpincastSession
-
setDirty
public void setDirty()Description copied from interface:SpincastSessionThis allows you to flag a session as being dirty, even if its attributes don't change. This will force the session to be saved in the database.- Specified by:
setDirtyin interfaceSpincastSession
-
invalidate
public void invalidate()Description copied from interface:SpincastSessionSets the session as "not valid anymore".- Specified by:
invalidatein interfaceSpincastSession
-
isInvalidated
public boolean isInvalidated()Description copied from interface:SpincastSessionHas the session been invalidated?- Specified by:
isInvalidatedin interfaceSpincastSession
-
toString
-