Interface DocRefService<T extends DocRefEntity>

  • Type Parameters:
    T - The class that represents the full document
    All Known Implementing Classes:
    DocRefServiceHttpClient

    public interface DocRefService<T extends DocRefEntity>
    Generic form of DocRef service, templated to the class the encapsulates the DocRef
    • Method Summary

      Modifier and Type Method Description
      java.util.Optional<T> copyDocument​(ServiceUser user, java.lang.String originalUuid, java.lang.String copyUuid)
      A notification from Stroom that a document is being copied.
      java.util.Optional<T> createDocument​(ServiceUser user, java.lang.String uuid, java.lang.String name)
      A new document has been created in Stroom
      java.util.Optional<java.lang.Boolean> deleteDocument​(ServiceUser user, java.lang.String uuid)
      The document with this UUID is being deleted in Stroom.
      ExportDTO exportDocument​(ServiceUser user, java.lang.String uuid)
      Used to export the full details of a document for transfer.
      java.util.Optional<T> get​(ServiceUser user, java.lang.String uuid)
      Retrieve the full config for the given DocRef
      java.util.List<T> getAll​(ServiceUser user)
      Retrieve all of the index entities currently registered
      default java.util.Optional<DocRefInfo> getInfo​(ServiceUser user, java.lang.String uuid)
      Retrieve the info about a doc ref
      java.lang.String getType()
      Get the doc ref type that this service wraps.
      java.util.Optional<T> importDocument​(ServiceUser user, java.lang.String uuid, java.lang.String name, java.lang.Boolean confirmed, java.util.Map<java.lang.String,​java.lang.String> dataMap)
      Used to import a document into the system
      java.util.Optional<T> moveDocument​(ServiceUser user, java.lang.String uuid)
      A Notification from Stroom that the document has been 'moved'.
      java.util.Optional<T> renameDocument​(ServiceUser user, java.lang.String uuid, java.lang.String name)
      A notifiation from Stroom that the name of a document has been changed.
      java.util.Optional<T> update​(ServiceUser user, java.lang.String uuid, T updatedConfig)
      Used to update a specific document.
    • Method Detail

      • getType

        java.lang.String getType()
        Get the doc ref type that this service wraps.
        Returns:
        The doc ref type name
      • getAll

        java.util.List<T> getAll​(ServiceUser user)
                          throws QueryApiException
        Retrieve all of the index entities currently registered
        Parameters:
        user - The logged in user
        Returns:
        The list of all known index entities
        Throws:
        QueryApiException - if anything goes wrong
      • get

        java.util.Optional<T> get​(ServiceUser user,
                                  java.lang.String uuid)
                           throws QueryApiException
        Retrieve the full config for the given DocRef
        Parameters:
        user - The logged in user
        uuid - The UUID of the docRef to return
        Returns:
        The full implementation specific config for this docRef.
        Throws:
        QueryApiException - if anything goes wrong
      • getInfo

        default java.util.Optional<DocRefInfo> getInfo​(ServiceUser user,
                                                       java.lang.String uuid)
                                                throws QueryApiException
        Retrieve the info about a doc ref
        Parameters:
        user - The logged in user
        uuid - The UUID of the doc ref to find
        Returns:
        The DocRefInfo for the UUID
        Throws:
        QueryApiException - if anything goes wrong
      • createDocument

        java.util.Optional<T> createDocument​(ServiceUser user,
                                             java.lang.String uuid,
                                             java.lang.String name)
                                      throws QueryApiException
        A new document has been created in Stroom
        Parameters:
        user - The logged in user
        uuid - The UUID of the document as created by stroom
        name - The name of the document to be created.
        Returns:
        The new index entity
        Throws:
        QueryApiException - if anything goes wrong
      • update

        java.util.Optional<T> update​(ServiceUser user,
                                     java.lang.String uuid,
                                     T updatedConfig)
                              throws QueryApiException
        Used to update a specific document. This will be used by our user interface to configure the underlying index and the stroom references to it
        Parameters:
        user - The logged in user
        uuid - The UUID of DocRef used to store the index configuration
        updatedConfig - The updated configuration
        Returns:
        The updated config
        Throws:
        QueryApiException - if anything goes wrong
      • copyDocument

        java.util.Optional<T> copyDocument​(ServiceUser user,
                                           java.lang.String originalUuid,
                                           java.lang.String copyUuid)
                                    throws QueryApiException
        A notification from Stroom that a document is being copied. The external system should copy it's configuration for the original into a new entity.
        Parameters:
        user - The logged in user
        originalUuid - The uuid of the document being copied
        copyUuid - The uuid of the copy
        Returns:
        The new index entity
        Throws:
        QueryApiException - if anything goes wrong
      • moveDocument

        java.util.Optional<T> moveDocument​(ServiceUser user,
                                           java.lang.String uuid)
                                    throws QueryApiException
        A Notification from Stroom that the document has been 'moved'. In most cases the external system will not care about this.
        Parameters:
        user - The logged in user
        uuid - The uuid of the document that was moved
        Returns:
        The updated index entity
        Throws:
        QueryApiException - if anything goes wrong
      • renameDocument

        java.util.Optional<T> renameDocument​(ServiceUser user,
                                             java.lang.String uuid,
                                             java.lang.String name)
                                      throws QueryApiException
        A notifiation from Stroom that the name of a document has been changed. Whilst the name belongs to stroom it may be helpful for the external system to know what the name is, but the name should not be used for referencing the DocRef between systems as it could easily be out of sync.
        Parameters:
        user - The logged in user
        uuid - The uuid of the document you want to rename.
        name - The new name of the document.
        Returns:
        The updated index entity
        Throws:
        QueryApiException - if anything goes wrong
      • deleteDocument

        java.util.Optional<java.lang.Boolean> deleteDocument​(ServiceUser user,
                                                             java.lang.String uuid)
                                                      throws QueryApiException
        The document with this UUID is being deleted in Stroom.
        Parameters:
        user - The logged in user
        uuid - The uuid of the document you want to delete.
        Returns:
        Optional boolean, if missing, the document could not be found, if false, it could not be deleted
        Throws:
        QueryApiException - if anything goes wrong
      • exportDocument

        ExportDTO exportDocument​(ServiceUser user,
                                 java.lang.String uuid)
                          throws QueryApiException
        Used to export the full details of a document for transfer.
        Parameters:
        user - The logged in user
        uuid - The UUID of the document to export
        Returns:
        The exported data
        Throws:
        QueryApiException - if anything goes wrong
      • importDocument

        java.util.Optional<T> importDocument​(ServiceUser user,
                                             java.lang.String uuid,
                                             java.lang.String name,
                                             java.lang.Boolean confirmed,
                                             java.util.Map<java.lang.String,​java.lang.String> dataMap)
                                      throws QueryApiException
        Used to import a document into the system
        Parameters:
        user - The logged in user
        uuid - The UUID of the document to import
        name - The Name of the document to import
        confirmed - Used to indicate if this is a dry run
        dataMap - The data that gives all the implementation specific details
        Returns:
        The imported document
        Throws:
        QueryApiException - if anything goes wrong