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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidCalled by a JDA session when a WebSocket should be started.The store for global rate-limits of all types.getShardedGateway(JDA api) Called byDefaultShardManagerwhen a new shards is starting.voidCalled 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, waitMethods inherited from interface net.dv8tion.jda.api.utils.SessionController
getGateway, setConcurrency
-
Constructor Details
-
SessionControllerAdapter
public SessionControllerAdapter()
-
-
Method Details
-
appendSession
Description copied from interface:SessionControllerCalled 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:
appendSessionin interfaceSessionController- Parameters:
node- TheSessionConnectNode
-
removeSession
Description copied from interface:SessionControllerCalled 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:
removeSessionin interfaceSessionController- Parameters:
node- TheSessionConnectNodeto remove from the queue.
-
getRateLimitHandle
Description copied from interface:SessionControllerThe 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:
getRateLimitHandlein interfaceSessionController- Returns:
- The global rate-limiter
-
getShardedGateway
Description copied from interface:SessionControllerCalled byDefaultShardManagerwhen a new shards is starting.
Should provide aSessionController.ShardedGatewaywith(gateway, shardTotal).- Specified by:
getShardedGatewayin 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:
-