SessionControllerpublic class SessionControllerAdapter extends java.lang.Object implements SessionController
SessionController.SessionConnectNodeIDENTIFY_DELAY| Constructor | Description |
|---|---|
SessionControllerAdapter() |
| Modifier and Type | Method | Description |
|---|---|---|
void |
appendSession(SessionController.SessionConnectNode node) |
Called by
WebSocketClient when
a WebSocket should be started. |
java.lang.String |
getGateway(JDA api) |
Called by
WebSocketClient
when a new session starts (Connecting, Reconnecting). |
net.dv8tion.jda.core.utils.tuple.Pair<java.lang.String,java.lang.Integer> |
getGatewayBot(JDA api) |
Called by
DefaultShardManager
when a new shards is starting. |
long |
getGlobalRatelimit() |
Provides the cross-session global REST ratelimit it received through
SessionController.setGlobalRatelimit(long). |
void |
removeSession(SessionController.SessionConnectNode node) |
Called by
WebSocketClient when
a JDA session has been shutdown. |
void |
setGlobalRatelimit(long ratelimit) |
Called by the
RateLimiter if the global rest ratelimit
has changed. |
public void appendSession(SessionController.SessionConnectNode node)
SessionControllerWebSocketClient when
a WebSocket should be started. (Connecting and Reconnecting)
SessionController.IDENTIFY_DELAY.appendSession in interface SessionControllernode - The SessionConnectNodepublic void removeSession(SessionController.SessionConnectNode node)
SessionControllerWebSocketClient when
a JDA session has been shutdown.
SessionConnectNode.run(boolean)
will be a no-op and does not contribute to the SessionController.IDENTIFY_DELAY.removeSession in interface SessionControllernode - The SessionConnectNode to remove from the queue.public long getGlobalRatelimit()
SessionControllerSessionController.setGlobalRatelimit(long).getGlobalRatelimit in interface SessionControllerpublic void setGlobalRatelimit(long ratelimit)
SessionControllerRateLimiter if the global rest ratelimit
has changed.setGlobalRatelimit in interface SessionControllerratelimit - The new global ratelimitpublic java.lang.String getGateway(JDA api)
SessionControllerWebSocketClient
when a new session starts (Connecting, Reconnecting).
getGateway in interface SessionControllerapi - The current JDA instance (used for RestActions and ShardInfo)public net.dv8tion.jda.core.utils.tuple.Pair<java.lang.String,java.lang.Integer> getGatewayBot(JDA api)
SessionControllerDefaultShardManager
when a new shards is starting.
Pair with (gateway, shardTotal).getGatewayBot in interface SessionControllerapi - The current JDA instance (used for RestActions and ShardInfo)SessionController.getGateway(net.dv8tion.jda.core.JDA)