Class DetachedSessionMetaData<C, B extends Batch>

java.lang.Object
org.wildfly.clustering.session.cache.metadata.DetachedSessionMetaData<C,B>
Type Parameters:
C - the session context type
B - the batch type
All Implemented Interfaces:
Expiration, ExpirationMetaData, ImmutableSessionMetaData, SessionMetaData

public class DetachedSessionMetaData<C, B extends Batch> extends Object implements SessionMetaData
SessionMetaData implementation for detached sessions.
Author:
Paul Ferraro
  • Constructor Details

    • DetachedSessionMetaData

      public DetachedSessionMetaData(Supplier<B> batchFactory, Supplier<Session<C>> sessionFactory)
      Creates detached session metadata using the specified session factory.
      Parameters:
      batchFactory - a batch factory
      sessionFactory - a session factory
  • Method Details

    • isExpired

      public boolean isExpired()
      Description copied from interface: ExpirationMetaData
      Indicates whether or not this object is expired.
      Specified by:
      isExpired in interface ExpirationMetaData
      Returns:
      true, if this object has expired, false otherwise.
    • getCreationTime

      public Instant getCreationTime()
      Description copied from interface: ImmutableSessionMetaData
      Returns the time this session was created.
      Specified by:
      getCreationTime in interface ImmutableSessionMetaData
      Returns:
      the time this session was created
    • getLastAccessStartTime

      public Optional<Instant> getLastAccessStartTime()
      Description copied from interface: ImmutableSessionMetaData
      If present, returns the start time of the last request to access this session.
      Specified by:
      getLastAccessStartTime in interface ImmutableSessionMetaData
      Returns:
      the start time of the last request to access this session, or empty if session was created during the current request.
    • getLastAccessEndTime

      public Optional<Instant> getLastAccessEndTime()
      Description copied from interface: ImmutableSessionMetaData
      If present, returns the end time of the last request to access this session.
      Specified by:
      getLastAccessEndTime in interface ImmutableSessionMetaData
      Returns:
      the end time of the last request to access this session, or empty if session was created during the current request.
    • getMaxIdle

      public Optional<Duration> getMaxIdle()
      Description copied from interface: Expiration
      When present, defines the maximum duration of time since last access, after which managed state will expire.
      Specified by:
      getMaxIdle in interface Expiration
      Returns:
      the optional duration of time since last access after which managed state will expire
    • setMaxIdle

      public void setMaxIdle(Duration duration)
      Description copied from interface: SessionMetaData
      Specifies the duration of time since last access after which this session will expire.
      Specified by:
      setMaxIdle in interface SessionMetaData
      Parameters:
      duration - the maximum idle duration
    • setLastAccess

      public void setLastAccess(Instant startTime, Instant endTime)
      Description copied from interface: SessionMetaData
      Sets the time this session was last accessed.
      Specified by:
      setLastAccess in interface SessionMetaData
      Parameters:
      startTime - the start time of the last request
      endTime - the end time of the last request