public class ClusterClientSession extends Object implements ClientSession
| 构造器和说明 |
|---|
ClusterClientSession(List<ClientSession> sessions) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
close()
关闭
|
List<ClientSession> |
getSessionAll()
获取所有会话
|
ClientSession |
getSessionOne()
获取一个会话(轮询负栽均衡)
|
boolean |
isValid()
是否有效
|
void |
reconnect()
手动重连(一般是自动)
|
SendStream |
send(String event,
Entity entity)
发送
|
RequestStream |
sendAndRequest(String event,
Entity entity,
long timeout)
发送并请求(限为一次答复;指定超时)
|
SubscribeStream |
sendAndSubscribe(String event,
Entity entity,
long timeout)
发送并订阅(答复结束之前,不限答复次数)
|
String |
sessionId()
获取会话Id
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitsendAndRequest, sendAndSubscribepublic ClusterClientSession(List<ClientSession> sessions)
public List<ClientSession> getSessionAll()
public ClientSession getSessionOne()
public boolean isValid()
ClientSessionisValid 在接口中 ClientSessionpublic String sessionId()
ClientSessionsessionId 在接口中 ClientSessionpublic void reconnect()
throws IOException
ClientSessionreconnect 在接口中 ClientSessionIOExceptionpublic SendStream send(String event, Entity entity) throws IOException
send 在接口中 ClientSessionevent - 事件entity - 实体IOExceptionpublic RequestStream sendAndRequest(String event, Entity entity, long timeout) throws IOException
sendAndRequest 在接口中 ClientSessionevent - 事件entity - 实体timeout - 超时(单位:毫秒)IOExceptionpublic SubscribeStream sendAndSubscribe(String event, Entity entity, long timeout) throws IOException
sendAndSubscribe 在接口中 ClientSessionevent - 事件entity - 实体timeout - 超时(单位:毫秒)IOExceptionpublic void close()
throws IOException
close 在接口中 Closeableclose 在接口中 AutoCloseableIOExceptionCopyright © 2024. All rights reserved.