Package org.wildfly.clustering.session
Class OOBSession<C,B extends org.wildfly.clustering.cache.batch.Batch>
java.lang.Object
org.wildfly.clustering.session.OOBSession<C,B>
- Type Parameters:
C- the session contextB- the batch type
- All Implemented Interfaces:
AutoCloseable,Expiration,ExpirationMetaData,org.wildfly.clustering.server.Registration,ImmutableSession,ImmutableSessionAttributes,ImmutableSessionMetaData,Session<C>,SessionAttributes,SessionMetaData
public class OOBSession<C,B extends org.wildfly.clustering.cache.batch.Batch>
extends Object
implements Session<C>, SessionMetaData, SessionAttributes
Out-of-band session implementation, for use outside the context of a request.
- Author:
- Paul Ferraro
-
Field Summary
Fields inherited from interface org.wildfly.clustering.server.Registration
EMPTY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()getAttribute(String name) Retrieves the value of the specified attribute.Returns the names of the attributes of this session.Returns this session's attributes.Returns the local context of this session.Returns the time this session was created.getId()Specifies this session's unique identifier.Returns the end time of the last request to access this session, or null if session was created during the current request.Returns the start time of the last request to access this session, or null if session was created during the current request.Returns this session's meta data.voidInvalidates this session.booleanbooleanisNew()Indicates whether or not this session was created by the current thread.booleanisValid()Indicates whether or not this session is valid.removeAttribute(String name) Removes the specified attribute.setAttribute(String name, Object value) Sets the specified attribute to the specified value.voidsetLastAccess(Instant startTime, Instant endTime) Sets the time this session was last accessed.voidsetTimeout(Duration duration) Set the time interval as a duration, after which this session will expire.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.wildfly.clustering.server.expiration.Expiration
isImmortalMethods inherited from interface org.wildfly.clustering.session.ImmutableSessionAttributes
getAttributesMethods inherited from interface org.wildfly.clustering.session.ImmutableSessionMetaData
getLastAccessTime
-
Constructor Details
-
OOBSession
-
-
Method Details
-
getId
Description copied from interface:ImmutableSessionSpecifies this session's unique identifier.- Specified by:
getIdin interfaceImmutableSession- Returns:
- a unique identifier for this session.
-
getMetaData
Description copied from interface:ImmutableSessionReturns this session's meta data.- Specified by:
getMetaDatain interfaceImmutableSession- Specified by:
getMetaDatain interfaceSession<C>- Returns:
- this session's meta data
-
getAttributes
Description copied from interface:ImmutableSessionReturns this session's attributes.- Specified by:
getAttributesin interfaceImmutableSession- Specified by:
getAttributesin interfaceSession<C>- Returns:
- this session's attributes
-
getContext
Description copied from interface:SessionReturns the local context of this session. The local context is *not* replicated to other nodes in the cluster.- Specified by:
getContextin interfaceSession<C>- Returns:
- a local context
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceorg.wildfly.clustering.server.Registration
-
isNew
public boolean isNew()Description copied from interface:ImmutableSessionMetaDataIndicates whether or not this session was created by the current thread.- Specified by:
isNewin interfaceImmutableSessionMetaData- Returns:
- true, if this session is new, false otherwise
-
isValid
public boolean isValid()Description copied from interface:ImmutableSessionIndicates whether or not this session is valid.- Specified by:
isValidin interfaceImmutableSession- Returns:
- true, if this session is valid, false otherwise
-
invalidate
public void invalidate()Description copied from interface:SessionInvalidates this session.- Specified by:
invalidatein interfaceSession<C>
-
isExpired
public boolean isExpired()- Specified by:
isExpiredin interfaceExpirationMetaData
-
getCreationTime
Description copied from interface:ImmutableSessionMetaDataReturns the time this session was created.- Specified by:
getCreationTimein interfaceImmutableSessionMetaData- Returns:
- the time this session was created
-
getLastAccessStartTime
Description copied from interface:ImmutableSessionMetaDataReturns the start time of the last request to access this session, or null if session was created during the current request.- Specified by:
getLastAccessStartTimein interfaceImmutableSessionMetaData- Returns:
- the start time of the last request to access this session, or null if session was created during the current request.
-
getLastAccessEndTime
Description copied from interface:ImmutableSessionMetaDataReturns the end time of the last request to access this session, or null if session was created during the current request.- Specified by:
getLastAccessEndTimein interfaceImmutableSessionMetaData- Returns:
- the end time of the last request to access this session, or null if session was created during the current request.
-
getTimeout
- Specified by:
getTimeoutin interfaceExpiration
-
setLastAccess
Description copied from interface:SessionMetaDataSets the time this session was last accessed.- Specified by:
setLastAccessin interfaceSessionMetaData
-
setTimeout
Description copied from interface:SessionMetaDataSet the time interval as a duration, after which this session will expire.- Specified by:
setTimeoutin interfaceSessionMetaData- Parameters:
duration- a time duration
-
getAttributeNames
Description copied from interface:ImmutableSessionAttributesReturns the names of the attributes of this session.- Specified by:
getAttributeNamesin interfaceImmutableSessionAttributes- Returns:
- a set of unique attribute names
-
getAttribute
Description copied from interface:ImmutableSessionAttributesRetrieves the value of the specified attribute.- Specified by:
getAttributein interfaceImmutableSessionAttributes- Parameters:
name- a unique attribute name- Returns:
- the attribute value, or null if the attribute does not exist.
-
removeAttribute
Description copied from interface:SessionAttributesRemoves the specified attribute.- Specified by:
removeAttributein interfaceSessionAttributes- Parameters:
name- a unique attribute name- Returns:
- the removed attribute value, or null if the attribute does not exist.
-
setAttribute
Description copied from interface:SessionAttributesSets the specified attribute to the specified value.- Specified by:
setAttributein interfaceSessionAttributes- Parameters:
name- a unique attribute namevalue- the attribute value- Returns:
- the old attribute value, or null if the attribute did not previously exist.
-