public class WampSession extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
DESTRUCTION_CALLBACK_NAME_PREFIX
Prefix for the name of session attributes used to store destruction callbacks.
|
static String |
SESSION_COMPLETED_NAME
Key set after the session is completed
|
static String |
SESSION_MUTEX_NAME
Key for the mutex session attribute
|
| Constructor and Description |
|---|
WampSession(org.springframework.web.socket.WebSocketSession webSocketSession) |
| Modifier and Type | Method and Description |
|---|---|
void |
addPrefix(String prefix,
String uri) |
<T> T |
getAttribute(String name)
Return the value for the attribute of the given name, if any.
|
String[] |
getAttributeNames()
Retrieve the names of all attributes.
|
String |
getAuthKey() |
String |
getChallenge() |
String |
getPrefix(String curie) |
Map<String,String> |
getPrefixes() |
Object |
getSessionMutex()
Expose the object to synchronize on for the underlying session.
|
String |
getSignature() |
org.springframework.web.socket.WebSocketSession |
getWebSocketSession() |
String |
getWebSocketSessionId()
Return an id for the associated WebSocket session.
|
boolean |
hasPrefixes() |
boolean |
isAuthenticated() |
boolean |
isAuthRequested() |
boolean |
isSessionCompleted()
Whether the
sessionCompleted() was already invoked. |
void |
registerDestructionCallback(String name,
Runnable callback)
Register a callback to execute on destruction of the specified attribute.
|
void |
removeAttribute(String name)
Remove the attribute of the given name, if it exists.
|
void |
sessionCompleted()
Invoked when the session is completed.
|
void |
setAttribute(String name,
Object value)
Set the value with the given name replacing an existing value (if any).
|
void |
setAuthKey(String authKey) |
void |
setChallenge(String challenge) |
void |
setSignature(String signature) |
public static final String SESSION_MUTEX_NAME
public static final String SESSION_COMPLETED_NAME
public static final String DESTRUCTION_CALLBACK_NAME_PREFIX
public WampSession(org.springframework.web.socket.WebSocketSession webSocketSession)
public <T> T getAttribute(String name)
name - the name of the attributenull if not foundpublic org.springframework.web.socket.WebSocketSession getWebSocketSession()
public void setAttribute(String name, Object value)
name - the name of the attributevalue - the value for the attributepublic void removeAttribute(String name)
Also removes the registered destruction callback for the specified attribute, if any. However it does not execute the callback. It is assumed the removed object will continue to be used and destroyed independently at the appropriate time.
name - the name of the attributepublic String[] getAttributeNames()
nullpublic void registerDestructionCallback(String name, Runnable callback)
name - the name of the attribute to register the callback forcallback - the destruction callback to be executedpublic String getWebSocketSessionId()
null)public Object getSessionMutex()
null)public boolean isSessionCompleted()
sessionCompleted() was already invoked.public void sessionCompleted()
public boolean isAuthRequested()
public boolean isAuthenticated()
public String getAuthKey()
public void setAuthKey(String authKey)
public String getChallenge()
public void setChallenge(String challenge)
public String getSignature()
public void setSignature(String signature)
public boolean hasPrefixes()
Copyright © 2014–2017. All rights reserved.