Class SpincastSessionDefault

java.lang.Object
org.spincast.plugins.session.SpincastSessionDefault
All Implemented Interfaces:
SpincastSession

public class SpincastSessionDefault extends Object implements SpincastSession
  • Constructor Details

    • SpincastSessionDefault

      public SpincastSessionDefault(org.spincast.core.json.JsonManager jsonManager, SpincastSessionManager spincastSessionManager)
      Constructor for a *new* session.
    • SpincastSessionDefault

      public SpincastSessionDefault(String sessionId, Instant creationDate, Instant modificationDate, @Nullable org.spincast.core.json.JsonObject attributes, org.spincast.core.json.JsonManager jsonManager, SpincastSessionManager spincastSessionManager)
    • SpincastSessionDefault

      public SpincastSessionDefault(String sessionId, Instant creationDate, Instant modificationDate, @Nullable org.spincast.core.json.JsonObject attributes, boolean setAsDirty, org.spincast.core.json.JsonManager jsonManager, SpincastSessionManager spincastSessionManager)
    • SpincastSessionDefault

      public SpincastSessionDefault(String sessionId, Instant creationDate, Instant modificationDate, org.spincast.core.json.JsonObject attributes, boolean setAsDirty, boolean isNew, org.spincast.core.json.JsonManager jsonManager, SpincastSessionManager spincastSessionManager)
  • Method Details

    • getJsonManager

      protected org.spincast.core.json.JsonManager getJsonManager()
    • getSpincastSessionManager

      protected SpincastSessionManager getSpincastSessionManager()
    • getAttributesHash

      protected String getAttributesHash()
    • getAttributesInitialHash

      protected String getAttributesInitialHash()
    • isForcedAsDirty

      protected boolean isForcedAsDirty()
    • getId

      public String getId()
      Description copied from interface: SpincastSession
      The unique id of this session.
      Specified by:
      getId in interface SpincastSession
    • isNew

      public boolean isNew()
      Description copied from interface: SpincastSession
      Returns true if the session has been created in the current request.
      Specified by:
      isNew in interface SpincastSession
    • getAttributes

      public org.spincast.core.json.JsonObject getAttributes()
      Description copied from interface: SpincastSession
      Returns a mutable JsonObject representing the attributes of the session. You can use this object to get/retrieve/delete attributes.
      Specified by:
      getAttributes in interface SpincastSession
    • getCreationDate

      public Instant getCreationDate()
      Description copied from interface: SpincastSession
      The Instant at which the session was created.
      Specified by:
      getCreationDate in interface SpincastSession
    • getModificationDate

      public Instant getModificationDate()
      Description copied from interface: SpincastSession
      The Instant at which the session was modified for the last time.
      Specified by:
      getModificationDate in interface SpincastSession
    • isDirty

      public boolean isDirty()
      Description copied from interface: SpincastSession
      Was the session modified since it was loaded?
      Specified by:
      isDirty in interface SpincastSession
    • 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 interface SpincastSession
    • invalidate

      public void invalidate()
      Description copied from interface: SpincastSession
      Sets the session as "not valid anymore".
      Specified by:
      invalidate in interface SpincastSession
    • isInvalidated

      public boolean isInvalidated()
      Description copied from interface: SpincastSession
      Has the session been invalidated?
      Specified by:
      isInvalidated in interface SpincastSession
    • toString

      public String toString()
      Overrides:
      toString in class Object