Modifier and Type | Class and Description |
---|---|
class |
ClientGroupContext |
Constructor and Description |
---|
ClientChannelContext(GroupContext groupContext)
创建一个虚拟ChannelContext,主要用来模拟一些操作,真实场景中用得少
|
ClientChannelContext(GroupContext groupContext,
AsynchronousSocketChannel asynchronousSocketChannel) |
Constructor and Description |
---|
TioClusterMessageListener(GroupContext groupContext) |
Modifier and Type | Field and Description |
---|---|
GroupContext |
ChannelContext.groupContext |
Modifier and Type | Method and Description |
---|---|
GroupContext |
ChannelContext.getGroupContext() |
Modifier and Type | Method and Description |
---|---|
static boolean |
Tio.IpBlacklist.add(GroupContext groupContext,
String ip)
把ip添加到黑名单
|
static Boolean |
Tio.bSend(GroupContext groupContext,
String ip,
int port,
Packet packet)
发送到指定的ip和port
|
static Boolean |
Tio.bSendToAll(GroupContext groupContext,
Packet packet,
ChannelContextFilter channelContextFilter)
发消息到所有连接
|
static Boolean |
Tio.bSendToBsId(GroupContext groupContext,
String bsId,
Packet packet)
阻塞发消息给指定业务ID
|
static Boolean |
Tio.bSendToGroup(GroupContext groupContext,
String group,
Packet packet)
发消息到组
|
static Boolean |
Tio.bSendToGroup(GroupContext groupContext,
String group,
Packet packet,
ChannelContextFilter channelContextFilter)
发消息到组
|
static Boolean |
Tio.bSendToId(GroupContext groupContext,
String channelId,
Packet packet)
发消息给指定ChannelContext id
|
static Boolean |
Tio.bSendToIp(GroupContext groupContext,
String ip,
Packet packet)
阻塞发送到指定ip对应的集合
|
static Boolean |
Tio.bSendToIp(GroupContext groupContext,
String ip,
Packet packet,
ChannelContextFilter channelContextFilter)
阻塞发送到指定ip对应的集合
|
static Boolean |
Tio.bSendToSet(GroupContext groupContext,
SetWithLock<ChannelContext> setWithLock,
Packet packet,
ChannelContextFilter channelContextFilter)
发消息到指定集合
|
static Boolean |
Tio.bSendToToken(GroupContext groupContext,
String token,
Packet packet)
阻塞发消息到指定token
|
static Boolean |
Tio.bSendToUser(GroupContext groupContext,
String userid,
Packet packet)
阻塞发消息给指定用户
|
static void |
Tio.IpBlacklist.clear(GroupContext groupContext)
清空黑名单
|
static void |
Tio.close(GroupContext groupContext,
String clientIp,
Integer clientPort,
Throwable throwable,
String remark)
关闭连接
|
static Collection<String> |
Tio.IpBlacklist.getAll(GroupContext groupContext)
获取ip黑名单列表
|
static SetWithLock<ChannelContext> |
Tio.getAllChannelContexts(GroupContext groupContext)
获取所有连接,包括当前处于断开状态的
|
static ChannelContext |
Tio.getChannelContextByBsId(GroupContext groupContext,
String bsId)
根据业务id找ChannelContext
|
static ChannelContext |
Tio.getChannelContextByClientNode(GroupContext groupContext,
String clientIp,
Integer clientPort)
根据clientip和clientport获取ChannelContext
|
static ChannelContext |
Tio.getChannelContextById(GroupContext groupContext,
String channelId)
根据id获取ChannelContext
|
static SetWithLock<ChannelContext> |
Tio.getChannelContextsByGroup(GroupContext groupContext,
String group)
获取一个组的所有客户端
|
static SetWithLock<ChannelContext> |
Tio.getChannelContextsByToken(GroupContext groupContext,
String token)
根据token获取SetWithLock
|
static SetWithLock<ChannelContext> |
Tio.getChannelContextsByUserid(GroupContext groupContext,
String userid)
根据userid获取SetWithLock
|
static Page<ChannelContext> |
Tio.getPageOfAll(GroupContext groupContext,
Integer pageIndex,
Integer pageSize) |
static <T> Page<T> |
Tio.getPageOfAll(GroupContext groupContext,
Integer pageIndex,
Integer pageSize,
Converter<T> converter) |
static Page<ChannelContext> |
Tio.getPageOfGroup(GroupContext groupContext,
String group,
Integer pageIndex,
Integer pageSize) |
static <T> Page<T> |
Tio.getPageOfGroup(GroupContext groupContext,
String group,
Integer pageIndex,
Integer pageSize,
Converter<T> converter) |
static int |
Tio.groupCount(GroupContext groupContext,
String group)
群组有多少个连接
|
void |
ChannelContext.init(GroupContext groupContext,
AsynchronousSocketChannel asynchronousSocketChannel) |
static boolean |
Tio.IpBlacklist.isInBlacklist(GroupContext groupContext,
String ip)
是否在黑名单中
|
static void |
Tio.notifyClusterForBsId(GroupContext groupContext,
String bsId,
Packet packet) |
static void |
Tio.notifyClusterForGroup(GroupContext groupContext,
String group,
Packet packet)
在集群环境下,把群组消息通知到集群中的其它机器
|
static void |
Tio.notifyClusterForId(GroupContext groupContext,
String channelId,
Packet packet)
在集群环境下,把channelId消息通知到集群中的其它机器
|
static void |
Tio.notifyClusterForIp(GroupContext groupContext,
String ip,
Packet packet)
在集群环境下,把IP消息通知到集群中的其它机器
|
static void |
Tio.notifyClusterForToken(GroupContext groupContext,
String token,
Packet packet)
在集群环境下,把token消息通知到集群中的其它机器
|
static void |
Tio.notifyClusterForUser(GroupContext groupContext,
String userid,
Packet packet)
在集群环境下,把userid消息通知到集群中的其它机器
|
static void |
Tio.IpBlacklist.remove(GroupContext groupContext,
String ip)
把ip从黑名单中删除
|
static void |
Tio.remove(GroupContext groupContext,
String clientIp,
Integer clientPort,
Throwable throwable,
String remark)
和close方法一样,只不过不再进行重连等维护性的操作
|
static void |
Tio.remove(GroupContext groupContext,
String ip,
String remark)
删除client ip为指定值的所有连接
|
static Boolean |
Tio.send(GroupContext groupContext,
String ip,
int port,
Packet packet)
发送到指定的ip和port
|
static void |
Tio.sendToAll(GroupContext groupContext,
Packet packet) |
static void |
Tio.sendToAll(GroupContext groupContext,
Packet packet,
ChannelContextFilter channelContextFilter)
发消息到所有连接
|
static Boolean |
Tio.sendToBsId(GroupContext groupContext,
String bsId,
Packet packet)
发消息给指定业务ID
|
static void |
Tio.sendToGroup(GroupContext groupContext,
String group,
Packet packet)
发消息到组
|
static void |
Tio.sendToGroup(GroupContext groupContext,
String group,
Packet packet,
ChannelContextFilter channelContextFilter)
发消息到组
|
static Boolean |
Tio.sendToId(GroupContext groupContext,
String channelId,
Packet packet)
发消息给指定ChannelContext id
|
static void |
Tio.sendToIp(GroupContext groupContext,
String ip,
Packet packet)
发送到指定ip对应的集合
|
static void |
Tio.sendToIp(GroupContext groupContext,
String ip,
Packet packet,
ChannelContextFilter channelContextFilter)
发送到指定ip对应的集合
|
static void |
Tio.sendToSet(GroupContext groupContext,
SetWithLock<ChannelContext> setWithLock,
Packet packet,
ChannelContextFilter channelContextFilter)
发消息到指定集合
|
static Boolean |
Tio.sendToToken(GroupContext groupContext,
String token,
Packet packet)
发消息到指定token
|
static Boolean |
Tio.sendToUser(GroupContext groupContext,
String userid,
Packet packet)
发消息给指定用户
|
void |
ChannelContext.setGroupContext(GroupContext groupContext) |
void |
GroupContext.share(GroupContext groupContext) |
static void |
Tio.unbindUser(GroupContext groupContext,
String userid)
解除userid的绑定。一般用于多地登录,踢掉前面登录的场景
|
Constructor and Description |
---|
ChannelContext(GroupContext groupContext)
创建一个虚拟ChannelContext,主要用来模拟一些操作,真实场景中用得少
|
ChannelContext(GroupContext groupContext,
AsynchronousSocketChannel asynchronousSocketChannel) |
Constructor and Description |
---|
IpStatRemovalListener(GroupContext groupContext,
IpStatListener ipStatListener) |
Modifier and Type | Method and Description |
---|---|
ByteBuffer |
AioHandler.encode(Packet packet,
GroupContext groupContext,
ChannelContext channelContext)
编码
|
Modifier and Type | Method and Description |
---|---|
SetWithLock<ChannelContext> |
Ips.clients(GroupContext groupContext,
String ip)
一个ip有哪些客户端,有可能返回null
|
SetWithLock<ChannelContext> |
Groups.clients(GroupContext groupContext,
String groupid)
一个组有哪些客户端
|
SetWithLock<ChannelContext> |
Users.find(GroupContext groupContext,
String userid)
Find.
|
SetWithLock<ChannelContext> |
Tokens.find(GroupContext groupContext,
String token)
Find.
|
ChannelContext |
Ids.find(GroupContext groupContext,
String id)
Find.
|
ChannelContext |
BsIds.find(GroupContext groupContext,
String bsId) |
void |
Users.unbind(GroupContext groupContext,
String userid)
解除groupContext范围内所有ChannelContext的 userid绑定
|
void |
Tokens.unbind(GroupContext groupContext,
String token)
解除groupContext范围内所有ChannelContext的 token绑定
|
Constructor and Description |
---|
IpBlacklist(String id,
GroupContext groupContext) |
IpStats(GroupContext groupContext,
Long[] durations) |
Modifier and Type | Method and Description |
---|---|
static boolean |
SslUtils.isSsl(GroupContext groupContext)
是否是SSL连接
|
static boolean |
SslUtils.needSslEncrypt(Packet packet,
GroupContext groupContext)
是否需要对这个packet进行SSL加密
|
Modifier and Type | Method and Description |
---|---|
void |
IpStatListener.onExpired(GroupContext groupContext,
IpStat ipStat)
统计时间段到期后,用户可以在这个方法中实现把相关数据入库或是打日志等
|
void |
DefaultIpStatListener.onExpired(GroupContext groupContext,
IpStat ipStat) |
Modifier and Type | Method and Description |
---|---|
ByteBuffer |
FlashPolicyServerAioHandler.encode(Packet packet,
GroupContext groupContext,
ChannelContext channelContext) |
Modifier and Type | Method and Description |
---|---|
static ByteBuffer |
HttpResponseEncoder.encode(HttpResponse httpResponse,
GroupContext groupContext,
ChannelContext channelContext) |
Modifier and Type | Method and Description |
---|---|
ByteBuffer |
HttpServerAioHandler.encode(Packet packet,
GroupContext groupContext,
ChannelContext channelContext) |
Modifier and Type | Method and Description |
---|---|
void |
IpPathAccessStatListener.onExpired(GroupContext groupContext,
String ip,
IpAccessStat ipAccessStat) |
Constructor and Description |
---|
IpPathAccessStatRemovalListener(GroupContext groupContext,
IpPathAccessStatListener ipPathAccessStatListener) |
IpPathAccessStats(StatPathFilter statPathFilter,
GroupContext groupContext,
IpPathAccessStatListener ipPathAccessStatListener,
Long[] durations) |
Modifier and Type | Method and Description |
---|---|
void |
TokenPathAccessStatListener.onExpired(GroupContext groupContext,
String token,
TokenAccessStat tokenAccessStat) |
Constructor and Description |
---|
TokenPathAccessStatRemovalListener(GroupContext groupContext,
TokenPathAccessStatListener tokenPathAccessStatListener) |
TokenPathAccessStats(StatPathFilter statPathFilter,
CurrUseridGetter currUseridGetter,
GroupContext groupContext,
TokenPathAccessStatListener tokenPathAccessStatListener,
Long[] durations) |
TokenPathAccessStats(StatPathFilter statPathFilter,
TokenGetter tokenGetter,
CurrUseridGetter currUseridGetter,
GroupContext groupContext,
TokenPathAccessStatListener tokenPathAccessStatListener,
Long[] durations) |
Modifier and Type | Class and Description |
---|---|
class |
ServerGroupContext |
Constructor and Description |
---|
ServerChannelContext(GroupContext groupContext)
创建一个虚拟ChannelContext,主要用来模拟一些操作,真实场景中用得少
|
ServerChannelContext(GroupContext groupContext,
AsynchronousSocketChannel asynchronousSocketChannel) |
Modifier and Type | Method and Description |
---|---|
static ByteBuffer |
WsServerEncoder.encode(WsResponse wsResponse,
GroupContext groupContext,
ChannelContext channelContext) |
Modifier and Type | Method and Description |
---|---|
ByteBuffer |
WsServerAioHandler.encode(Packet packet,
GroupContext groupContext,
ChannelContext channelContext) |
Copyright © 2018. All rights reserved.