Class TokensClient

java.lang.Object
com.dtsx.astra.sdk.AbstractApiClient
com.dtsx.astra.sdk.org.TokensClient

public class TokensClient extends AbstractApiClient
Group token operations.
  • Constructor Details

    • TokensClient

      public TokensClient(String token)
      As immutable object use builder to initiate the object.
      Parameters:
      token - authenticated token
    • TokensClient

      public TokensClient(String token, ApiLocator.AstraEnvironment env)
      As immutable object use builder to initiate the object.
      Parameters:
      env - define target environment to be used
      token - authenticated token
  • Method Details

    • findAll

      public Stream<IamToken> findAll()
      List tokens
      Returns:
      list of tokens for this organization
    • findById

      public Optional<IamToken> findById(String tokenId)
      Retrieve role information from its id.
      Parameters:
      tokenId - token identifier
      Returns:
      role information
    • exist

      public boolean exist(String tokenId)
      Check in existence of a token.
      Parameters:
      tokenId - token identifier
      Returns:
      if the provided token exist
    • delete

      public void delete(String tokenId)
      Revoke a token.
      Parameters:
      tokenId - token identifier
    • create

      public CreateTokenResponse create(String role)
      Create token
      Parameters:
      role - create a token with dedicated role
      Returns:
      created token
    • create

      public CreateTokenResponse create(DefaultRoles role)
      Create token
      Parameters:
      role - create a token with dedicated role
      Returns:
      created token
    • getEndpointTokens

      public String getEndpointTokens()
      Endpoint to access schema for namespace.
      Returns:
      endpoint
    • getEndpointToken

      public String getEndpointToken(String tokenId)
      Endpoint to access dbs (static)
      Parameters:
      tokenId - token identifier
      Returns:
      token endpoint