Class OOBSession<L,B extends Batch>
java.lang.Object
org.wildfly.clustering.web.session.oob.OOBSession<L,B>
- All Implemented Interfaces:
AutoCloseable,Expiration,ExpirationMetaData,ImmutableSession,ImmutableSessionAttributes,ImmutableSessionMetaData,Session<L>,SessionAttributes,SessionMetaData
public class OOBSession<L,B extends Batch>
extends Object
implements Session<L>, SessionMetaData, SessionAttributes
Out-of-band session implementation, for use outside the context of a request.
- Author:
- Paul Ferraro
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Indicates that the application thread is finished with this session.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 time this session was created.getId()Specifies this session's unique identifier.Returns the start time of the last request to access this session.Returns the start time of the last request to access this session.Returns the local context of this session.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.ee.expiration.Expiration
isImmortalMethods inherited from interface org.wildfly.clustering.web.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.
-
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
-
getMetaData
Description copied from interface:SessionReturns this session's meta data.- Specified by:
getMetaDatain interfaceImmutableSession- Specified by:
getMetaDatain interfaceSession<L>- Returns:
- this session's meta data
-
invalidate
public void invalidate()Description copied from interface:SessionInvalidates this session.- Specified by:
invalidatein interfaceSession<L>
-
getAttributes
Description copied from interface:SessionReturns this session's attributes.- Specified by:
getAttributesin interfaceImmutableSession- Specified by:
getAttributesin interfaceSession<L>- Returns:
- this session's attributes
-
getLocalContext
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:
getLocalContextin interfaceSession<L>- Returns:
- a local context
-
close
public void close()Description copied from interface:SessionIndicates that the application thread is finished with this session. This method is intended to be invoked within the context of a batch.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceSession<L>
-
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
-
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.- Specified by:
getLastAccessStartTimein interfaceImmutableSessionMetaData- Returns:
- the start time of the last request to access this session.
-
getLastAccessEndTime
Description copied from interface:ImmutableSessionMetaDataReturns the start time of the last request to access this session.- Specified by:
getLastAccessEndTimein interfaceImmutableSessionMetaData- Returns:
- the start time of the last request to access this session.
-
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.
-