public interface RedirectSystem extends Terminable
| Modifier and Type | Interface and Description |
|---|---|
static interface |
RedirectSystem.ReceivedResponse
Represents the response to a redirect request.
|
static interface |
RedirectSystem.Request
Encapsulates a redirect request
|
static interface |
RedirectSystem.RequestHandler
Handles incoming redirect requests for this server
|
static class |
RedirectSystem.Response
Encapsulates the response to a
RedirectSystem.Request. |
EMPTY| Modifier and Type | Method and Description |
|---|---|
void |
addDefaultParameterProvider(RedirectParameterProvider provider)
Adds a default parameter provider.
|
void |
close()
Closes this resource.
|
static <M extends Messenger & InstanceData & PlayerRedirector> |
create(M messenger)
Creates a new
RedirectSystem instance. |
static RedirectSystem |
create(Messenger messenger,
InstanceData instanceData,
PlayerRedirector redirecter)
Creates a new
RedirectSystem instance. |
int |
getExpectedConnectionsCount()
Gets the number of connections which have been allowed, but not yet fully established.
|
static RedirectSystem |
obtain(Supplier<RedirectSystem> ifElse)
Tries to obtain an instance of RedirectSystem from the services manager, falling
back to given supplier if one is not already present.
|
default Promise<RedirectSystem.ReceivedResponse> |
redirectPlayer(String serverId,
org.bukkit.entity.Player player,
Map<String,String> params)
Makes a request to redirect the given player to the given server.
|
Promise<RedirectSystem.ReceivedResponse> |
redirectPlayer(String serverId,
Profile profile,
Map<String,String> params)
Makes a request to redirect the given player to the given server.
|
void |
setEnsure(boolean ensureJoinedViaQueue)
Sets if the system should ensure that incoming connections were made (and accepted) by the
redirect system.
|
void |
setHandler(RedirectSystem.RequestHandler handler)
Sets the
RedirectSystem.RequestHandler for this instance. |
bindWith, closeAndReportException, closeSilently, isClosedstatic RedirectSystem create(Messenger messenger, InstanceData instanceData, PlayerRedirector redirecter)
RedirectSystem instance. These should be shared if possible.messenger - the messengerinstanceData - the instance dataredirecter - the redirecterstatic <M extends Messenger & InstanceData & PlayerRedirector> RedirectSystem create(M messenger)
RedirectSystem instance. These should be shared if possible.messenger - the messengerstatic RedirectSystem obtain(Supplier<RedirectSystem> ifElse)
ifElse - the supplierPromise<RedirectSystem.ReceivedResponse> redirectPlayer(@Nonnull String serverId, @Nonnull Profile profile, @Nonnull Map<String,String> params)
serverId - the server to redirect toprofile - the player to be redirectedparams - the parameters for the requestdefault Promise<RedirectSystem.ReceivedResponse> redirectPlayer(@Nonnull String serverId, @Nonnull org.bukkit.entity.Player player, @Nonnull Map<String,String> params)
serverId - the server to redirect toplayer - the player to be redirectedparams - the parameters for the requestvoid setHandler(@Nonnull RedirectSystem.RequestHandler handler)
RedirectSystem.RequestHandler for this instance.handler - the handlervoid addDefaultParameterProvider(@Nonnull RedirectParameterProvider provider)
provider - the providervoid setEnsure(boolean ensureJoinedViaQueue)
ensureJoinedViaQueue - if the system should ensure all joins are in the redirect queueint getExpectedConnectionsCount()
void close()
Terminableclose in interface AutoCloseableclose in interface TerminableCopyright © 2022. All rights reserved.