|
Errai 3.0.1-SNAPSHOT | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface QueueSession
The combination of a communication channel (identified by an HTTPSession or other communication session, such as an open WebSocket channel) with an Errai Bus queue ID. An instance of QueueSession identifies a physical communication link with a specific subject on a remote bus. A single communication link typically has many QueueSession instances (one per bus subject).
QueueSession provides a map-like facility for storing and retrieving arbitrary object ("attributes") by name. These attributes are shared among all QueueSession instances that are associated with the same communication channel (for example, an HTTPSession or a WebSocketChannel).
Method Summary | ||
---|---|---|
void |
addSessionEndListener(SessionEndListener listener)
Registers a listener that will notified when this session ends. |
|
boolean |
endSession()
Closes this session and notifies the SessionEndListener s (optional operation; not all QueueSession
implementations are closeable). |
|
|
getAttribute(Class<T> type,
String attribute)
Returns the value associated with the given key. |
|
Collection<String> |
getAttributeNames()
Returns the names of all attributes within this session. |
|
String |
getParentSessionId()
Returns the ID of the session this QueueSession wraps. |
|
String |
getSessionId()
Returns the ID of this session, which uniquely identifies it within the scope of this client (or server for a server side session). |
|
boolean |
hasAttribute(String attribute)
Returns true if the specified attribute exists. |
|
boolean |
isValid()
|
|
Object |
removeAttribute(String attribute)
Removes the specified attribute from this session. |
|
void |
setAttribute(String attribute,
Object value)
Associates the given value with the given key, replacing the existing value, if any, for the key. |
Method Detail |
---|
String getSessionId()
String getParentSessionId()
boolean endSession()
SessionEndListener
s (optional operation; not all QueueSession
implementations are closeable).
void setAttribute(String attribute, Object value)
See the class-level documentation for a note on the scope of these attributes.
attribute
- the name (key) of the attribute. Not null.value
- new value for attribute. Null is permitted.<T> T getAttribute(Class<T> type, String attribute)
See the class-level documentation for a note on the scope of these attributes.
T
- the typetype
- the type to attempt to cast the attribute's value toattribute
- the name (key) of the attribute. Not null.
hasAttribute(String)
to test for the existence of a null-valued
attribute.Collection<String> getAttributeNames()
See the class-level documentation for a note on the scope of these attributes.
boolean hasAttribute(String attribute)
See the class-level documentation for a note on the scope of these attributes.
attribute
- the attribute name to search for.
Object removeAttribute(String attribute)
See the class-level documentation for a note on the scope of these attributes.
attribute
- the name of the attribute to remove.
void addSessionEndListener(SessionEndListener listener)
listener
- the listener to be notified at session end.boolean isValid()
|
Errai 3.0.1-SNAPSHOT | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |