Package org.spincast.plugins.session
Class SpincastSessionDefault
java.lang.Object
org.spincast.plugins.session.SpincastSessionDefault
- All Implemented Interfaces:
SpincastSession
-
Constructor Summary
ConstructorDescriptionSpincastSessionDefault
(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 mutableJsonObject
representing the attributes of the session.protected String
protected String
The Instant at which the session was created.getId()
The unique id of this session.protected JsonManager
The Instant at which the session was modified for the last time.protected SpincastSessionManager
void
Sets the session as "not valid anymore".boolean
isDirty()
Was the session modified since it was loaded?protected boolean
boolean
Has the session been invalidated?boolean
isNew()
Returnstrue
if the session has been created in the current request.void
setDirty()
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:SpincastSession
The unique id of this session.- Specified by:
getId
in interfaceSpincastSession
-
isNew
public boolean isNew()Description copied from interface:SpincastSession
Returnstrue
if the session has been created in the current request.- Specified by:
isNew
in interfaceSpincastSession
-
getAttributes
Description copied from interface:SpincastSession
Returns a mutableJsonObject
representing the attributes of the session. You can use this object to get/retrieve/delete attributes.- Specified by:
getAttributes
in interfaceSpincastSession
-
getCreationDate
Description copied from interface:SpincastSession
The Instant at which the session was created.- Specified by:
getCreationDate
in interfaceSpincastSession
-
getModificationDate
Description copied from interface:SpincastSession
The Instant at which the session was modified for the last time.- Specified by:
getModificationDate
in interfaceSpincastSession
-
isDirty
public boolean isDirty()Description copied from interface:SpincastSession
Was the session modified since it was loaded?- Specified by:
isDirty
in interfaceSpincastSession
-
setDirty
public void setDirty()Description copied from interface:SpincastSession
This 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:
setDirty
in interfaceSpincastSession
-
invalidate
public void invalidate()Description copied from interface:SpincastSession
Sets the session as "not valid anymore".- Specified by:
invalidate
in interfaceSpincastSession
-
isInvalidated
public boolean isInvalidated()Description copied from interface:SpincastSession
Has the session been invalidated?- Specified by:
isInvalidated
in interfaceSpincastSession
-
toString
-