public final class ProjectClient extends ProjectSchema implements IClient
EnjinHosts
Modifier and Type | Class and Description |
---|---|
static class |
ProjectClient.ProjectClientBuilder
Builder class for
ProjectClient . |
playerService, SCHEMA, walletService
assetService, balanceService, platformService, projectService, transactionService
middleware, schema
Modifier and Type | Method and Description |
---|---|
void |
auth(AccessToken accessToken)
Authenticates the client using the given access token model.
|
void |
auth(java.lang.String token)
Authenticates this client with the given token.
|
java.util.concurrent.CompletableFuture<java.lang.Void> |
authClient(@NonNull java.lang.String uuid,
@NonNull java.lang.String secret)
Sends a request to the platform to authenticate this client.
|
static ProjectClient.ProjectClientBuilder |
builder()
Creates a builder for this class.
|
void |
close() |
boolean |
isAuthenticated()
Determines whether this client is authenticated.
|
boolean |
isAutomaticReauthenticationEnabled() |
boolean |
isClosed()
Determines whether this client is closed.
|
boolean |
isReauthenticationRunning() |
advancedSendAsset, approveEnj, approveMaxEnj, authPlayer, authProject, bridgeAsset, bridgeAssets, bridgeClaimAsset, completeTrade, createAsset, createPlayer, createTrade, decreaseMaxMeltFee, decreaseMaxTransferFee, deletePlayer, getAssetsFromProjects, getPlayer, getPlayers, getWallet, getWallets, invalidateAssetMetadata, meltAsset, message, mintAsset, releaseReserve, resetEnjApproval, sendAsset, sendEnj, setApprovalForAll, setMeltFee, setTransferable, setTransferFee, setUri, setWhitelisted, unlinkWallet, updateName
cancelTransaction, getAsset, getAssets, getBalances, getBalancesFromProjects, getGasPrices, getPlatform, getProject, getRequest, getRequests, transactionRequest
createRequestBody, createResult, createService, getLoggerProvider, sendRequest, version
public void auth(java.lang.String token)
If this client has automatic reauthentication enabled, then this method will halt the reauthentication timer.
public void auth(AccessToken accessToken) throws java.lang.IllegalArgumentException
If this client has automatic reauthentication enabled, then this method may halt the reauthentication timer when
accessToken
is null. Otherwise the timer will be restarted.
accessToken
- The access token.java.lang.IllegalArgumentException
- If accessToken
is not null and either its
AccessToken.getToken()
method or AccessToken.getExpiresIn()
method returns null.public java.util.concurrent.CompletableFuture<java.lang.Void> authClient(@NonNull @NonNull java.lang.String uuid, @NonNull @NonNull java.lang.String secret) throws java.lang.IllegalStateException
If this client is enabled for automatic reauthentication, then it will cache the UUID and secret and
reauthenticate itself before the AccessToken
returned by the platform expires.
uuid
- The project's UUID.secret
- The project's secret.java.lang.IllegalStateException
- If this client is closed at the time this method is called.public void close()
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
public boolean isAuthenticated()
IClient
isAuthenticated
in interface IClient
public boolean isClosed()
IClient
public static ProjectClient.ProjectClientBuilder builder()
public boolean isAutomaticReauthenticationEnabled()
public boolean isReauthenticationRunning()