Class DefaultSessionMetaData
java.lang.Object
org.wildfly.clustering.session.cache.metadata.AbstractImmutableSessionMetaData
org.wildfly.clustering.session.cache.metadata.coarse.DefaultImmutableSessionMetaData
org.wildfly.clustering.session.cache.metadata.coarse.DefaultSessionMetaData
- All Implemented Interfaces:
AutoCloseable, Expiration, ExpirationMetaData, InvalidatableSessionMetaData, ImmutableSessionMetaData, SessionMetaData
public class DefaultSessionMetaData
extends DefaultImmutableSessionMetaData
implements InvalidatableSessionMetaData
Default session metadata implementation that delegates to a cache entry, triggering its mutator
Runnable.run() on close.- Author:
- Paul Ferraro
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultSessionMetaData(SessionMetaDataEntry entry, Runnable mutator) Session metadata for the specified entry and mutator. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Signals the end of the transient lifecycle of this session, typically triggered at the end of a given request.booleanInvalidates the session.booleanisValid()Indicates whether or not this session is still valid.voidsetLastAccess(Instant startTime, Instant endTime) Sets the time this session was last accessed.voidsetMaxIdle(Duration duration) Specifies the duration of time since last access after which this session will expire.Methods inherited from class DefaultImmutableSessionMetaData
getCreationTime, getLastAccessEndTime, getLastAccessStartTime, getMaxIdleMethods inherited from class AbstractImmutableSessionMetaData
toStringMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface Expiration
getMaxIdleMethods inherited from interface ExpirationMetaData
getExpirationTime, isExpiredMethods inherited from interface ImmutableSessionMetaData
getCreationTime, getLastAccessEndTime, getLastAccessStartTime, getLastAccessTime
-
Constructor Details
-
DefaultSessionMetaData
Session metadata for the specified entry and mutator.- Parameters:
entry- a session metadata entrymutator- a runner that mutates the cache entry associated with this session metadata
-
-
Method Details
-
isValid
public boolean isValid()Description copied from interface:InvalidatableSessionMetaDataIndicates whether or not this session is still valid.- Specified by:
isValidin interfaceInvalidatableSessionMetaData- Returns:
- true, if this session is valid, false otherwise
-
invalidate
public boolean invalidate()Description copied from interface:InvalidatableSessionMetaDataInvalidates the session.- Specified by:
invalidatein interfaceInvalidatableSessionMetaData- Returns:
- true, if session was invalidated, false if it was already invalid.
-
setLastAccess
Description copied from interface:SessionMetaDataSets the time this session was last accessed.- Specified by:
setLastAccessin interfaceSessionMetaData- Parameters:
startTime- the start time of the last requestendTime- the end time of the last request
-
setMaxIdle
Description copied from interface:SessionMetaDataSpecifies the duration of time since last access after which this session will expire.- Specified by:
setMaxIdlein interfaceSessionMetaData- Parameters:
duration- the maximum idle duration
-
close
public void close()Description copied from interface:InvalidatableSessionMetaDataSignals the end of the transient lifecycle of this session, typically triggered at the end of a given request.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceInvalidatableSessionMetaData
-