Class DocRefResourceHttpClient<T extends DocRefEntity>

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable, DocRefResource

    public class DocRefResourceHttpClient<T extends DocRefEntity>
    extends java.lang.Object
    implements DocRefResource, java.io.Closeable
    • Method Summary

      Modifier and Type Method Description
      void close()  
      javax.ws.rs.core.Response copyDocument​(ServiceUser user, java.lang.String originalUuid, java.lang.String copyUuid)
      A notification from Stroom that a document is being copied.
      javax.ws.rs.core.Response createDocument​(ServiceUser user, java.lang.String uuid, java.lang.String name)
      A new document has been created in Stroom
      javax.ws.rs.core.Response deleteDocument​(ServiceUser user, java.lang.String uuid)
      The document with this UUID is being deleted in Stroom.
      javax.ws.rs.core.Response exportDocument​(ServiceUser user, java.lang.String uuid)
      Export the given document
      javax.ws.rs.core.Response get​(ServiceUser user, java.lang.String uuid)
      Retrieve the full config for the given DocRef
      javax.ws.rs.core.Response getAll​(ServiceUser user)
      Retrieve the full config for the given DocRef
      javax.ws.rs.core.Response getInfo​(ServiceUser user, java.lang.String uuid)
      Retrieve the full config for the given DocRef
      javax.ws.rs.core.Response 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)
      Import the data as a new document.
      javax.ws.rs.core.Response moveDocument​(ServiceUser user, java.lang.String uuid)
      A Notification from Stroom that the document has been 'moved'.
      javax.ws.rs.core.Response renameDocument​(ServiceUser user, java.lang.String uuid, java.lang.String name)
      A notifiation from Stroom that the name of a document has been changed.
      javax.ws.rs.core.Response update​(ServiceUser user, java.lang.String uuid, java.lang.String updatedConfig)
      Update the document
      javax.ws.rs.core.Response update​(ServiceUser user, java.lang.String uuid, T updatedConfig)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DocRefResourceHttpClient

        public DocRefResourceHttpClient​(java.lang.String baseUrl)
    • Method Detail

      • close

        public void close()
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
      • getAll

        public javax.ws.rs.core.Response getAll​(ServiceUser user)
        Description copied from interface: DocRefResource
        Retrieve the full config for the given DocRef
        Specified by:
        getAll in interface DocRefResource
        Parameters:
        user - Authenticated user passed in from web framework
        Returns:
        The full list of doc refs
      • get

        public javax.ws.rs.core.Response get​(ServiceUser user,
                                             java.lang.String uuid)
        Description copied from interface: DocRefResource
        Retrieve the full config for the given DocRef
        Specified by:
        get in interface DocRefResource
        Parameters:
        user - Authenticated user passed in from web framework
        uuid - The UUID of the docRef to return
        Returns:
        The full implementation specific config for this docRef.
      • getInfo

        public javax.ws.rs.core.Response getInfo​(ServiceUser user,
                                                 java.lang.String uuid)
        Description copied from interface: DocRefResource
        Retrieve the full config for the given DocRef
        Specified by:
        getInfo in interface DocRefResource
        Parameters:
        user - Authenticated user passed in from web framework
        uuid - The UUID of the docRef to return
        Returns:
        The DocRefInfo for the given DocRef
      • createDocument

        public javax.ws.rs.core.Response createDocument​(ServiceUser user,
                                                        java.lang.String uuid,
                                                        java.lang.String name)
        Description copied from interface: DocRefResource
        A new document has been created in Stroom
        Specified by:
        createDocument in interface DocRefResource
        Parameters:
        user - Authenticated user passed in from web framework
        uuid - The UUID of the document as created by stroom
        name - The name of the document to be created.
        Returns:
        A doc ref for the newly created document.
      • update

        public javax.ws.rs.core.Response update​(ServiceUser user,
                                                java.lang.String uuid,
                                                T updatedConfig)
      • update

        public javax.ws.rs.core.Response update​(ServiceUser user,
                                                java.lang.String uuid,
                                                java.lang.String updatedConfig)
        Description copied from interface: DocRefResource
        Update the document
        Specified by:
        update in interface DocRefResource
        Parameters:
        user - Authenticated user passed in from web framework
        uuid - The UUID of the document as created by stroom
        updatedConfig - The updated configuration
        Returns:
        The updated config
      • copyDocument

        public javax.ws.rs.core.Response copyDocument​(ServiceUser user,
                                                      java.lang.String originalUuid,
                                                      java.lang.String copyUuid)
        Description copied from interface: DocRefResource
        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.
        Specified by:
        copyDocument in interface DocRefResource
        Parameters:
        user - Authenticated user passed in from web framework
        originalUuid - The uuid of the document being copied
        copyUuid - The uuid of the copy
        Returns:
        A doc ref for the new document copy.
      • moveDocument

        public javax.ws.rs.core.Response moveDocument​(ServiceUser user,
                                                      java.lang.String uuid)
        Description copied from interface: DocRefResource
        A Notification from Stroom that the document has been 'moved'. In most cases the external system will not care about this.
        Specified by:
        moveDocument in interface DocRefResource
        Parameters:
        user - Authenticated user passed in from web framework
        uuid - The uuid of the document that was moved
        Returns:
        A doc ref for the moved document.
      • renameDocument

        public javax.ws.rs.core.Response renameDocument​(ServiceUser user,
                                                        java.lang.String uuid,
                                                        java.lang.String name)
        Description copied from interface: DocRefResource
        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.
        Specified by:
        renameDocument in interface DocRefResource
        Parameters:
        user - Authenticated user passed in from web framework
        uuid - The uuid of the document you want to rename.
        name - The new name of the document.
        Returns:
        A doc ref for the renamed document.
      • deleteDocument

        public javax.ws.rs.core.Response deleteDocument​(ServiceUser user,
                                                        java.lang.String uuid)
        Description copied from interface: DocRefResource
        The document with this UUID is being deleted in Stroom.
        Specified by:
        deleteDocument in interface DocRefResource
        Parameters:
        user - Authenticated user passed in from web framework
        uuid - The uuid of the document you want to delete.
        Returns:
        No content if OK
      • importDocument

        public javax.ws.rs.core.Response 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)
        Description copied from interface: DocRefResource
        Import the data as a new document.
        Specified by:
        importDocument in interface DocRefResource
        Parameters:
        user - Authenticated user passed in from web framework
        uuid - The UUID of the document to import
        name - The name of the document to import
        confirmed - Is the import a confirmed one? If it isn't then this is just a dry run.
        dataMap - The data to import
        Returns:
        The created document
      • exportDocument

        public javax.ws.rs.core.Response exportDocument​(ServiceUser user,
                                                        java.lang.String uuid)
        Description copied from interface: DocRefResource
        Export the given document
        Specified by:
        exportDocument in interface DocRefResource
        Parameters:
        user - Authenticated user passed in from web framework
        uuid - The UUID of the document to export
        Returns:
        A Map of Strings by Strings containing the exported data.