@MessengerProperties(optionClass=SourceRconOptions.class) public final class SourceRconMessenger extends NettyMessenger<SourceRconRequest,SourceRconResponse>
RCON Messenger
Modifier and Type | Class and Description |
---|---|
static class |
SourceRconMessenger.ConnectionStats |
static class |
SourceRconMessenger.Metadata |
class |
SourceRconMessenger.Statistics |
Constructor and Description |
---|
SourceRconMessenger(Options options)
Constructor for SourceRconMessenger.
|
Modifier and Type | Method and Description |
---|---|
void |
cleanup(boolean force)
Cleanup inactive connections
|
void |
close() |
protected void |
configure(Options options)
Populate configuration options.
|
protected NettyChannelFactory |
createChannelFactory()
createChannelFactory.
|
ChannelRegistry |
getChannelRegistry()
Getter for the field
registry . |
CredentialsStore |
getCredentialsStore()
Getter for the field
credentialsStore . |
SourceRconMessenger.Statistics |
getStatistics()
Getter for the field
statistics . |
void |
invalidate()
Invalidate all registered addresses and the connections associated with it
|
void |
invalidate(boolean onlyConnections)
Invalidates all registered addresses along with its connections.
|
void |
invalidate(InetSocketAddress address)
Invalidate both credentials and all it's
Channel 's associated with it |
void |
invalidate(InetSocketAddress address,
boolean connectionsOnly)
Invalidate the credentials and/or the
Channel 's associated with it |
boolean |
isAuthenticated(InetSocketAddress address)
Checks if the specified
InetSocketAddress has been previously authenticated. |
boolean |
isReauthenticate()
Check if reauthenticate flag is set
|
CompletableFuture<SourceRconResponse> |
send(InetSocketAddress address,
SourceRconRequest request)
Send request to the underlying
Transport |
acquireContext, applyDefault, attach, createFactoryProvider, getChannelFactory, getExecutor, getFactoryProvider, getOptions, getTransport, lockedOption, receive, send, transformProperties
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
get, get, getOrDefault, getOrDefault, lock, set, unlock
protected void configure(Options options)
configure
in class NettyMessenger<SourceRconRequest,SourceRconResponse>
options
- The Options
instance holding the configuration dataprotected NettyChannelFactory createChannelFactory()
createChannelFactory.
createChannelFactory
in class NettyMessenger<SourceRconRequest,SourceRconResponse>
NettyChannelFactory
objectpublic CompletableFuture<SourceRconResponse> send(InetSocketAddress address, SourceRconRequest request)
Send request to the underlying Transport
Route the rcon request to it's appropriate handler
send
in interface Messenger<SourceRconRequest,SourceRconResponse>
send
in class NettyMessenger<SourceRconRequest,SourceRconResponse>
address
- a InetSocketAddress
objectrequest
- a R objectCompletableFuture
objectpublic void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class NettyMessenger<SourceRconRequest,SourceRconResponse>
IOException
public boolean isReauthenticate()
Check if reauthenticate flag is set
true
if automatic re-authentication is enabled.public ChannelRegistry getChannelRegistry()
Getter for the field registry
.
ChannelRegistry
objectpublic CredentialsStore getCredentialsStore()
Getter for the field credentialsStore
.
CredentialsStore
objectInMemoryCredentialsStore
public boolean isAuthenticated(InetSocketAddress address)
InetSocketAddress
has been previously authenticated.
Note: This does not check the validity of the Credentials
registered to the address.
address
- The InetSocketAddress
to checktrue
if the address has been previously authenticated.@ApiStatus.Experimental @ApiStatus.Internal public SourceRconMessenger.Statistics getStatistics()
Getter for the field statistics
.
SourceRconMessenger.Statistics
objectpublic void cleanup(boolean force)
public void invalidate()
public void invalidate(boolean onlyConnections)
onlyConnections
- true
if we should only invalidate the Channel
's for the specified address.public void invalidate(InetSocketAddress address, boolean connectionsOnly)
Channel
's associated with itaddress
- The InetSocketAddress
to invalidateconnectionsOnly
- true
if we should only also invalidate the connections associated with the specified address, credentials will remain valid.public void invalidate(InetSocketAddress address)
Channel
's associated with itaddress
- a InetSocketAddress
objectCopyright © 2016–2024. All rights reserved.