Class AsyncCollectionManager

    • Constructor Detail

      • AsyncCollectionManager

        public AsyncCollectionManager​(Core core,
                                      String bucketName)
    • Method Detail

      • createCollection

        public CompletableFuture<Void> createCollection​(CollectionSpec collectionSpec)
        Creates a collection if it does not already exist.
        Parameters:
        collectionSpec - the collection spec that contains the properties of the collection.
        Returns:
        a CompletableFuture once the collection creation completed.
      • collectionExists

        public CompletableFuture<Boolean> collectionExists​(CollectionSpec collectionSpec)
        Checks if the given collection exists in this bucket.
        Parameters:
        collectionSpec - the collection spec that contains the properties of the collection.
        Returns:
        a CompletableFuture returning true if it exists, false otherwise.
      • createScope

        public CompletableFuture<Void> createScope​(ScopeSpec scopeSpec)
        Creates a scope if it does not already exist.
        Parameters:
        scopeSpec - the scope spec that contains the properties of the scope.
        Returns:
        a CompletableFuture once the scope creation completed.
      • dropCollection

        public CompletableFuture<Void> dropCollection​(CollectionSpec collectionSpec)
        Drops a collection if it exists.
        Parameters:
        collectionSpec - the collection spec that contains the properties of the collection.
        Returns:
        a CompletableFuture once the collection is dropped.