Package com.btcvelocity.api.queue
Interface QueueManager
public interface QueueManager
Manages the queue system for the proxy.
The queue manager maintains one Queue per registered backend server.
In a multi-proxy Redis setup, exactly one proxy acts as the master and
is responsible for running periodic transfer and server-ping tasks.
-
Method Summary
Modifier and TypeMethodDescription@NotNull QueueReturns theQueuefor the given server name, creating it if it does not yet exist.default @Nullable QueuegetQueueFor(@NotNull Player player) Returns the queue the given player is currently in, ornullif the player is not queued in any queue.@Nullable QueuegetQueueFor(@NotNull UUID uniqueId) Returns the queue the given player is currently in, ornullif the player is not queued in any queue.@NotNull Collection<? extends Queue> Returns an immutable snapshot of all managed queues.booleanReturnstrueif this proxy is currently the master proxy responsible for running transfer and server-ping tasks.default booleanReturnstrueif the given player is present in any queue.default booleanReturnstrueif the given player is present in any queue.voidqueue(@NotNull Player player, @NotNull RegisteredServer server) Validates eligibility and adds the given player to the queue for the specified server.voidreload()Reloads the queue manager, rescheduling internal tasks based on the latest configuration.default voidremovePlayerEntirely(@NotNull Player player) Immediately removes the given player from all queues they are currently in.voidremovePlayerEntirely(@NotNull UUID uniqueId) Immediately removes the given player from all queues they are currently in.voidteardown()Tears down the queue manager, cancelling all scheduled tasks and clearing all queues.
-
Method Details
-
reload
void reload()Reloads the queue manager, rescheduling internal tasks based on the latest configuration. -
teardown
void teardown()Tears down the queue manager, cancelling all scheduled tasks and clearing all queues. -
isMasterProxy
boolean isMasterProxy()Returnstrueif this proxy is currently the master proxy responsible for running transfer and server-ping tasks.In memory mode this always returns
true.- Returns:
trueif this is the master proxy
-
getQueue
Returns theQueuefor the given server name, creating it if it does not yet exist.- Parameters:
serverName- the name of the target server- Returns:
- the associated queue
- Throws:
IllegalArgumentException- if no server with that name is registered
-
getQueues
Returns an immutable snapshot of all managed queues.- Returns:
- all queues
-
isQueued
Returnstrueif the given player is present in any queue.- Parameters:
uniqueId- the unique id of the player to check- Returns:
trueif the player is queued
-
isQueued
Returnstrueif the given player is present in any queue.- Parameters:
player- the player to check- Returns:
trueif the player is queued
-
getQueueFor
Returns the queue the given player is currently in, ornullif the player is not queued in any queue.- Parameters:
uniqueId- the unique id of the player to look up- Returns:
- the queue, or
null
-
getQueueFor
Returns the queue the given player is currently in, ornullif the player is not queued in any queue.- Parameters:
player- the player to look up- Returns:
- the queue, or
null
-
queue
Validates eligibility and adds the given player to the queue for the specified server.This method checks bypass permissions, multi-queue restrictions, paused state, and version compatibility before enqueueing the player.
- Parameters:
player- the player to queueserver- the target server
-
removePlayerEntirely
Immediately removes the given player from all queues they are currently in.- Parameters:
uniqueId- the unique id of the player to remove
-
removePlayerEntirely
Immediately removes the given player from all queues they are currently in.- Parameters:
player- the player to remove
-