Package net.dv8tion.jda.api.utils
Class SessionControllerAdapter
java.lang.Object
net.dv8tion.jda.api.utils.SessionControllerAdapter
- All Implemented Interfaces:
SessionController
- Direct Known Subclasses:
ConcurrentSessionController
Simple implementation of
SessionController
without supporting concurrency.- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.dv8tion.jda.api.utils.SessionController
SessionController.SessionConnectNode, SessionController.ShardedGateway
-
Field Summary
Fields inherited from interface net.dv8tion.jda.api.utils.SessionController
IDENTIFY_DELAY
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Called by a JDA session when a WebSocket should be started.The store for global rate-limits of all types.getShardedGateway
(JDA api) Called byDefaultShardManager
when a new shards is starting.void
Called by a JDA session when a shutdown has been requested.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.dv8tion.jda.api.utils.SessionController
getGateway, setConcurrency
-
Constructor Details
-
SessionControllerAdapter
public SessionControllerAdapter()
-
-
Method Details
-
appendSession
Description copied from interface:SessionController
Called by a JDA session when a WebSocket should be started. (Connecting and Reconnecting)
This should only add the node to a queue and execute the queue with respect to theSessionController.IDENTIFY_DELAY
.- Specified by:
appendSession
in interfaceSessionController
- Parameters:
node
- TheSessionConnectNode
-
removeSession
Description copied from interface:SessionController
Called by a JDA session when a shutdown has been requested.
When this happened theSessionConnectNode.run(boolean)
will be a no-op and does not contribute to theSessionController.IDENTIFY_DELAY
.- Specified by:
removeSession
in interfaceSessionController
- Parameters:
node
- TheSessionConnectNode
to remove from the queue.
-
getRateLimitHandle
Description copied from interface:SessionController
The store for global rate-limits of all types.
This can be used to share the global rate-limit information between shards on the same IP.- Specified by:
getRateLimitHandle
in interfaceSessionController
- Returns:
- The global rate-limiter
-
getShardedGateway
Description copied from interface:SessionController
Called byDefaultShardManager
when a new shards is starting.
Should provide aSessionController.ShardedGateway
with(gateway, shardTotal)
.- Specified by:
getShardedGateway
in interfaceSessionController
- Parameters:
api
- The current JDA instance (used for RestActions and ShardInfo)- Returns:
- The ShardedGateway instance consisting of the gateway endpoint to connect to and the shardTotal
- See Also:
-