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
Session
protected void processConnect(Request request) throws Exception
Exception
public void disconnect() throws Exception
Session
disconnect
in interface Session
Exception
public long getLastAccessedTime()
Session
getLastAccessedTime
in interface Session
public int getMaxInactiveInterval()
Session
getMaxInactiveInterval
in interface Session
public String getId()
Session
public void invalidate()
Session
invalidate
in interface Session
public void destroy()
DestroyableSession
destroy
in interface DestroyableSession
public Map<TopicKey,String> getFailedSubscriptions()
Session
getFailedSubscriptions
in interface Session
public Collection<TopicKey> getSuccessfulSubscriptions()
Session
getSuccessfulSubscriptions
in interface Session
public void subscribe(String[] topics)
Session
public Collection<MessageData> getMessages()
Session
getMessages
in interface Session
public void clearBroadcastedMessages(long sequenceNumber)
Session
clearBroadcastedMessages
in interface Session
Copyright © 2015 JBoss by Red Hat. All Rights Reserved.