SessionController
public class SessionControllerAdapter extends java.lang.Object implements SessionController
SessionController.SessionConnectNode
IDENTIFY_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)
SessionController
WebSocketClient
when
a WebSocket should be started. (Connecting and Reconnecting)
SessionController.IDENTIFY_DELAY
.appendSession
in interface SessionController
node
- The SessionConnectNode
public void removeSession(SessionController.SessionConnectNode node)
SessionController
WebSocketClient
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 SessionController
node
- The SessionConnectNode
to remove from the queue.public long getGlobalRatelimit()
SessionController
SessionController.setGlobalRatelimit(long)
.getGlobalRatelimit
in interface SessionController
public void setGlobalRatelimit(long ratelimit)
SessionController
RateLimiter
if the global rest ratelimit
has changed.setGlobalRatelimit
in interface SessionController
ratelimit
- The new global ratelimitpublic java.lang.String getGateway(JDA api)
SessionController
WebSocketClient
when a new session starts (Connecting, Reconnecting).
getGateway
in interface SessionController
api
- 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)
SessionController
DefaultShardManager
when a new shards is starting.
Pair
with (gateway, shardTotal)
.getGatewayBot
in interface SessionController
api
- The current JDA instance (used for RestActions and ShardInfo)SessionController.getGateway(net.dv8tion.jda.core.JDA)