Interface CollectionManagementService

  • All Superinterfaces:
    Configurable, Service

    public interface CollectionManagementService
    extends Service
    CollectionManagementService is a Service that enables the basic management of collections within a database. The functionality provided is very basic because collection management varies widely among databases. This service simply provides functionality for those databases that are able to implement this basic functionality.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String SERVICE_NAME  
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void copy​(java.lang.String collection, java.lang.String destination, java.lang.String newName)
      Copy the collection specified by collection to the given destination and newName.
      void copyResource​(java.lang.String resourcePath, java.lang.String destinationPath, java.lang.String newName)
      Copy the resource specified by the resourcePath to the given destinationPath and newName.
      Collection createCollection​(java.lang.String name)
      Creates a new Collection in the database.
      void move​(java.lang.String collection, java.lang.String destination, java.lang.String newName)
      Moves either a collection or
      void moveResource​(java.lang.String resourcePath, java.lang.String destinationPath, java.lang.String newName)
      Moves the resource specified by the resourcePath to the given destinationPath and newName.
      void removeCollection​(java.lang.String name)
      Removes a named Collection from the system.
    • Method Detail

      • createCollection

        Collection createCollection​(java.lang.String name)
                             throws XMLDBException
        Creates a new Collection in the database. The default configuration of the database is determined by the implementer. The new Collection will be created relative to the Collection from which the CollectionManagementService was retrieved.
        Parameters:
        name - The name of the collection to create.
        Returns:
        The created Collection instance.
        Throws:
        XMLDBException - with expected error codes. ErrorCodes.VENDOR_ERROR for any vendor specific errors that occur.
      • removeCollection

        void removeCollection​(java.lang.String name)
                       throws XMLDBException
        Removes a named Collection from the system. The name for the Collection to remove is relative to the Collection from which the CollectionManagementService was retrieved.
        Parameters:
        name - The name of the collection to remove.
        Throws:
        XMLDBException - with expected error codes. ErrorCodes.VENDOR_ERROR for any vendor specific errors that occur.
      • move

        void move​(java.lang.String collection,
                  java.lang.String destination,
                  java.lang.String newName)
           throws XMLDBException
        Moves either a collection or
        Parameters:
        collection - The source collection
        destination - The destination collection
        newName - The new name of the moved collection in the destination collection
        Throws:
        XMLDBException - with expected error codes. ErrorCodes.VENDOR_ERROR for any vendor specific errors that occur.
      • moveResource

        void moveResource​(java.lang.String resourcePath,
                          java.lang.String destinationPath,
                          java.lang.String newName)
                   throws XMLDBException
        Moves the resource specified by the resourcePath to the given destinationPath and newName.
        Parameters:
        resourcePath - The source document
        destinationPath - The destination collection
        newName - The new name of the moved source in the destination collection
        Throws:
        XMLDBException - with expected error codes. ErrorCodes.VENDOR_ERROR for any vendor specific errors that occur.
      • copyResource

        void copyResource​(java.lang.String resourcePath,
                          java.lang.String destinationPath,
                          java.lang.String newName)
                   throws XMLDBException
        Copy the resource specified by the resourcePath to the given destinationPath and newName.
        Parameters:
        resourcePath - The source document
        destinationPath - The destination collection
        newName - The new name of the copied source in the destination collection
        Throws:
        XMLDBException - with expected error codes. ErrorCodes.VENDOR_ERROR for any vendor specific errors that occur.
      • copy

        void copy​(java.lang.String collection,
                  java.lang.String destination,
                  java.lang.String newName)
           throws XMLDBException
        Copy the collection specified by collection to the given destination and newName.
        Parameters:
        collection - The source collection
        destination - The destination collection
        newName - The new name of the copied collection in the destination collection
        Throws:
        XMLDBException - with expected error codes. ErrorCodes.VENDOR_ERROR for any vendor specific errors that occur.