SessionController
public class ProvidingSessionController extends SessionControllerAdapter
SessionController.SessionConnectNode
IDENTIFY_DELAY
Constructor | Description |
---|---|
ProvidingSessionController(SessionReconnectQueue queue,
ShardedRateLimiter rateLimiter) |
Modifier and Type | Method | Description |
---|---|---|
void |
appendSession(SessionController.SessionConnectNode node) |
Called by
WebSocketClient when
a WebSocket should be started. |
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. |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getGateway, getGatewayBot
public ProvidingSessionController(SessionReconnectQueue queue, ShardedRateLimiter rateLimiter)
public void appendSession(SessionController.SessionConnectNode node)
SessionController
WebSocketClient
when
a WebSocket should be started. (Connecting and Reconnecting)
SessionController.IDENTIFY_DELAY
.appendSession
in interface SessionController
appendSession
in class SessionControllerAdapter
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
removeSession
in class SessionControllerAdapter
node
- The SessionConnectNode
to remove from the queue.public long getGlobalRatelimit()
SessionController
SessionController.setGlobalRatelimit(long)
.getGlobalRatelimit
in interface SessionController
getGlobalRatelimit
in class SessionControllerAdapter
public void setGlobalRatelimit(long ratelimit)
SessionController
RateLimiter
if the global rest ratelimit
has changed.setGlobalRatelimit
in interface SessionController
setGlobalRatelimit
in class SessionControllerAdapter
ratelimit
- The new global ratelimit