public abstract class JetlangBaseSession extends Object implements JetlangSession, JetlangMessagePublisher
Modifier and Type | Field and Description |
---|---|
protected CloseableChannel<HeartbeatEvent> |
Heartbeat |
protected Object |
id |
protected CloseableChannel<LogoutEvent> |
Logout |
protected CloseableChannel<SessionMessage<?>> |
Messages |
protected CloseableChannel<ReadTimeoutEvent> |
ReadTimeout |
protected CloseableChannel<SessionCloseEvent> |
SessionClose |
protected CloseableChannel<SessionRequest> |
SessionRequest |
protected CloseableChannel<SessionTopic> |
SubscriptionRequest |
protected CloseableChannel<String> |
UnsubscribeRequest |
Constructor and Description |
---|
JetlangBaseSession(Object id) |
Modifier and Type | Method and Description |
---|---|
org.jetlang.channels.Subscriber<HeartbeatEvent> |
getHeartbeatChannel() |
org.jetlang.channels.Subscriber<LogoutEvent> |
getLogoutChannel() |
org.jetlang.channels.Subscriber<ReadTimeoutEvent> |
getReadTimeoutChannel() |
org.jetlang.channels.Subscriber<SessionCloseEvent> |
getSessionCloseChannel() |
Object |
getSessionId() |
org.jetlang.channels.Subscriber<SessionMessage<?>> |
getSessionMessageChannel() |
org.jetlang.channels.Subscriber<SessionRequest> |
getSessionRequestChannel() |
org.jetlang.channels.Subscriber<SessionTopic> |
getSubscriptionRequestChannel() |
org.jetlang.channels.Subscriber<String> |
getUnsubscribeChannel() |
protected <T> CloseableChannel<T> |
newChannel() |
void |
onClose(SessionCloseEvent sessionCloseEvent) |
void |
onHb() |
abstract void |
onLogout() |
void |
onMessage(String topic,
Object msg) |
void |
onReadTimeout(ReadTimeoutEvent readTimeoutEvent) |
void |
onRequest(int reqId,
String reqmsgTopic,
Object reqmsg) |
abstract void |
onSubscriptionRequest(String topic) |
abstract void |
onUnsubscribeRequest(String topic) |
abstract void |
publish(byte[] data)
publish raw bytes.
|
abstract void |
publishIfSubscribed(String topic,
byte[] data) |
abstract void |
reply(int reqId,
String replyTopic,
Object replyMsg) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
disconnect, publish
publish
protected final CloseableChannel<SessionTopic> SubscriptionRequest
protected final CloseableChannel<String> UnsubscribeRequest
protected final CloseableChannel<LogoutEvent> Logout
protected final CloseableChannel<HeartbeatEvent> Heartbeat
protected final CloseableChannel<SessionMessage<?>> Messages
protected final CloseableChannel<ReadTimeoutEvent> ReadTimeout
protected final CloseableChannel<SessionCloseEvent> SessionClose
protected final CloseableChannel<SessionRequest> SessionRequest
protected final Object id
public JetlangBaseSession(Object id)
protected <T> CloseableChannel<T> newChannel()
public Object getSessionId()
getSessionId
in interface JetlangSession
public abstract void onLogout()
public abstract void onSubscriptionRequest(String topic)
public abstract void onUnsubscribeRequest(String topic)
public void onHb()
public abstract void publish(byte[] data)
JetlangSession
publish
in interface JetlangSession
public abstract void reply(int reqId, String replyTopic, Object replyMsg)
reply
in interface JetlangMessagePublisher
public abstract void publishIfSubscribed(String topic, byte[] data)
public org.jetlang.channels.Subscriber<SessionTopic> getSubscriptionRequestChannel()
getSubscriptionRequestChannel
in interface JetlangSession
public org.jetlang.channels.Subscriber<LogoutEvent> getLogoutChannel()
getLogoutChannel
in interface JetlangSession
public org.jetlang.channels.Subscriber<HeartbeatEvent> getHeartbeatChannel()
getHeartbeatChannel
in interface JetlangSession
public org.jetlang.channels.Subscriber<SessionMessage<?>> getSessionMessageChannel()
getSessionMessageChannel
in interface JetlangSession
public org.jetlang.channels.Subscriber<ReadTimeoutEvent> getReadTimeoutChannel()
getReadTimeoutChannel
in interface JetlangSession
public org.jetlang.channels.Subscriber<SessionCloseEvent> getSessionCloseChannel()
getSessionCloseChannel
in interface JetlangSession
public org.jetlang.channels.Subscriber<String> getUnsubscribeChannel()
getUnsubscribeChannel
in interface JetlangSession
public org.jetlang.channels.Subscriber<SessionRequest> getSessionRequestChannel()
getSessionRequestChannel
in interface JetlangSession
public void onClose(SessionCloseEvent sessionCloseEvent)
public void onReadTimeout(ReadTimeoutEvent readTimeoutEvent)
Copyright © 2016. All Rights Reserved.