Class CollectionManager

    • Method Detail

      • createCollection

        public 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.
      • collectionExists

        public 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:
        true if it exists, false otherwise.
      • dropCollection

        public void dropCollection​(CollectionSpec collectionSpec)
        Drops a collection if it exists.
        Parameters:
        collectionSpec - the collection spec that contains the properties of the collection.
      • createScope

        public 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.
      • dropScope

        public void dropScope​(String scopeName)
        Drops a scope if it exists.
        Parameters:
        scopeName - the name of the scope to drop.
      • getScope

        public ScopeSpec getScope​(String scopeName)
        Returns the scope if it exists.
        Parameters:
        scopeName - the name of the scope.
        Returns:
        the ScopeSpec or an exception if it does not exist.
      • getAllScopes

        public List<ScopeSpec> getAllScopes()
        Returns all scopes in this bucket.
        Returns:
        a list of all scopes in this bucket.