Class NamespaceClient

java.lang.Object
io.stargate.sdk.doc.NamespaceClient

public class NamespaceClient extends Object
Client for Document API 'Namespace' resource /v2/namespaces
Author:
Cedrick LUNVEN (@clunven)
  • Field Details

  • Constructor Details

  • Method Details

    • find

      public Optional<Namespace> find()
      Find a namespace and its metadata based on its id
      Returns:
      Namespace
    • exist

      public boolean exist()
      Check if namespace exists.
      Returns:
      boolean
    • create

      public void create(DataCenter... datacenters)
      Create a namespace.
      Parameters:
      datacenters - DataCenter
    • createSimple

      public void createSimple(int replicas)
      Create a namespace.
      Parameters:
      replicas - int
    • delete

      public void delete()
      Delete a namespace.
    • collections

      public Stream<CollectionDefinition> collections()
      List collections in namespace. GET /v2/namespaces/{namespace-id}/collections
      Returns:
      CollectionDefinition
    • collectionNames

      public Stream<String> collectionNames()
      List collections in namespace. GET /v2/namespaces/{namespace-id}/collections
      Returns:
      String
    • collection

      public CollectionClient collection(String collectionName)
      Move to the collection client
      Parameters:
      collectionName - String
      Returns:
      CollectionClient
    • getNamespace

      public String getNamespace()
      Getter accessor for attribute 'namespace'.
      Returns:
      current value of 'namespace'