public class SessionImpl extends Object implements Session, DestroyableSession
Session| Constructor and Description |
|---|
SessionImpl(String id,
SessionManager sessionManager,
TopicsContext topicsContext) |
| Modifier and Type | Method and Description |
|---|---|
void |
clearBroadcastedMessages(long sequenceNumber)
Clears all the queues messages associated with this session that has sequence number lower than provided number
|
void |
connect(Request request)
Connects given request to this session
|
void |
destroy()
Destroy the session and associated resources
|
void |
disconnect()
Releases/disconnects associated request from this session
|
Map<TopicKey,String> |
getFailedSubscriptions()
Get a map of topic keys this session failed to be subscribed to including the message why the subscription failed
|
String |
getId()
Returns unique identifier of this session.
|
long |
getLastAccessedTime()
Returns the last time when the session was accessed
|
int |
getMaxInactiveInterval()
How much minutes is session kept alive since the last time it has been accessed before it is destroyed
|
Collection<MessageData> |
getMessages()
Returns list of messages associated with this push session
|
protected Request |
getRequest()
Returns
Request associated with this session |
Collection<TopicKey> |
getSuccessfulSubscriptions()
Get a list of topic keys this session is successfully subscribed to
|
void |
invalidate()
Invalidates this session, making it non-active
|
protected void |
processConnect(Request request)
Process connecting of given request to this session and try to post messages if there are any
|
void |
push(TopicKey topicKey,
String serializedData)
Pushes given data to given topic key
|
void |
subscribe(String[] topics)
Subscribe this session to given topics
|
public SessionImpl(String id, SessionManager sessionManager, TopicsContext topicsContext)
public void connect(Request request) throws Exception
Sessionprotected void processConnect(Request request) throws Exception
Exceptionpublic void disconnect()
throws Exception
Sessiondisconnect in interface SessionExceptionpublic long getLastAccessedTime()
SessiongetLastAccessedTime in interface Sessionpublic int getMaxInactiveInterval()
SessiongetMaxInactiveInterval in interface Sessionpublic String getId()
Sessionpublic void invalidate()
Sessioninvalidate in interface Sessionpublic void destroy()
DestroyableSessiondestroy in interface DestroyableSessionpublic Map<TopicKey,String> getFailedSubscriptions()
SessiongetFailedSubscriptions in interface Sessionpublic Collection<TopicKey> getSuccessfulSubscriptions()
SessiongetSuccessfulSubscriptions in interface Sessionpublic void subscribe(String[] topics)
Sessionpublic Collection<MessageData> getMessages()
SessiongetMessages in interface Sessionpublic void clearBroadcastedMessages(long sequenceNumber)
SessionclearBroadcastedMessages in interface SessionCopyright © 2014 JBoss by Red Hat. All Rights Reserved.