public class SourceRconChannelRegistry extends Object implements ChannelRegistry
ChannelRegistry
. Uses a SetMultimap
to store managed netty based Channel
instances.Constructor and Description |
---|
SourceRconChannelRegistry() |
Modifier and Type | Method and Description |
---|---|
Set<InetSocketAddress> |
getAddresses()
A unique set of registered
InetSocketAddress |
Set<io.netty.channel.Channel> |
getChannels(InetSocketAddress address)
The
Channel 's acquired for the specified InetSocketAddress |
int |
getCount(InetSocketAddress address)
The number of
Channel registered for the specified InetSocketAddress |
Set<Map.Entry<InetSocketAddress,io.netty.channel.Channel>> |
getEntries()
getEntries.
|
boolean |
isRegistered(io.netty.channel.Channel channel)
Check if
Channel is registered by this instance. |
void |
register(io.netty.channel.Channel channel)
Register a newly acquired
Channel . |
boolean |
unregister(io.netty.channel.Channel channel)
Unregister a
Channel . |
public void register(io.netty.channel.Channel channel) throws ChannelRegistrationException
Channel
. This method is thread-safe.register
in interface ChannelRegistry
channel
- The Channel
to be registeredChannelRegistrationException
- If the registration failspublic boolean unregister(io.netty.channel.Channel channel)
Channel
. This method is thread-safe.unregister
in interface ChannelRegistry
channel
- The Channel
to be unregisteredtrue
if the Channel
was successfuly unregistred.public boolean isRegistered(io.netty.channel.Channel channel)
Channel
is registered by this instance.isRegistered
in interface ChannelRegistry
channel
- The Channel
to check.true
if the Channel
is registered by this instance.public Set<Map.Entry<InetSocketAddress,io.netty.channel.Channel>> getEntries()
getEntries.
getEntries
in interface ChannelRegistry
Set
objectpublic Set<InetSocketAddress> getAddresses()
A unique set of registered InetSocketAddress
getAddresses
in interface ChannelRegistry
Set
objectpublic Set<io.netty.channel.Channel> getChannels(InetSocketAddress address)
The Channel
's acquired for the specified InetSocketAddress
getChannels
in interface ChannelRegistry
address
- The InetSocketAddress
to be used for the lookupSet
of Channel
instances acquired for the addresspublic int getCount(InetSocketAddress address)
Channel
registered for the specified InetSocketAddress
getCount
in interface ChannelRegistry
address
- The InetSocketAddress
to lookupChannel
for the specified addressCopyright © 2016–2024. All rights reserved.