Class DbKeyspacesClient

java.lang.Object
com.dtsx.astra.sdk.AbstractApiClient
com.dtsx.astra.sdk.db.DbKeyspacesClient

public class DbKeyspacesClient extends AbstractApiClient
Delegate Operation to work on Keyspaces
  • Constructor Details

    • DbKeyspacesClient

      public DbKeyspacesClient(String token, String databaseId)
      As immutable object use builder to initiate the object.
      Parameters:
      token - authenticated token
      databaseId - database identifier
    • DbKeyspacesClient

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

    • findAll

      public Set<String> findAll()
      Find all keyspace in current DB.
      Returns:
      all keyspace names
    • exist

      public boolean exist(String keyspace)
      Evaluate if a keyspace exists.
      Parameters:
      keyspace - keyspace identifier
      Returns:
      if keyspace exists
    • create

      public void create(String keyspace)
      Create a new keyspace in a DB.
      Parameters:
      keyspace - keyspace name to create
    • delete

      public void delete(String keyspace)
      Delete a keyspace from db.
      Parameters:
      keyspace - current keyspace
    • getEndpointKeyspace

      public String getEndpointKeyspace(String keyspaceName)
      Endpoint to access keyspace. (static).
      Parameters:
      keyspaceName - name of keyspace
      Returns:
      endpoint