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
-
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.longProvides the cross-session global REST ratelimit it received throughSessionController.setGlobalRatelimit(long).getShardedGateway(JDA api) Called byDefaultShardManagerwhen a new shards is starting.voidCalled by a JDA session when a shutdown has been requested.voidsetGlobalRatelimit(long ratelimit) Called by the RateLimiter if the global rest ratelimit has changed.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.
-
getGlobalRatelimit
public long getGlobalRatelimit()Description copied from interface:SessionControllerProvides the cross-session global REST ratelimit it received throughSessionController.setGlobalRatelimit(long).- Specified by:
getGlobalRatelimitin interfaceSessionController- Returns:
- The current global REST ratelimit or -1 if unset
-
setGlobalRatelimit
public void setGlobalRatelimit(long ratelimit) Description copied from interface:SessionControllerCalled by the RateLimiter if the global rest ratelimit has changed.- Specified by:
setGlobalRatelimitin interfaceSessionController- Parameters:
ratelimit- The new global ratelimit
-
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:
-