Package stroom.query.audit.client
Class DocRefServiceHttpClient<T extends DocRefEntity>
- java.lang.Object
-
- stroom.query.audit.client.DocRefServiceHttpClient<T>
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
,DocRefService<T>
public class DocRefServiceHttpClient<T extends DocRefEntity> extends java.lang.Object implements DocRefService<T>, java.io.Closeable
-
-
Constructor Summary
Constructors Constructor Description DocRefServiceHttpClient(java.lang.String type, java.lang.Class<T> docRefEntityClass, java.lang.String baseUrl)
-
Method Summary
Modifier and Type Method Description void
close()
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 Stroomjava.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 DocRefjava.util.List<T>
getAll(ServiceUser user)
Retrieve all of the index entities currently registeredjava.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 systemjava.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.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface stroom.query.audit.service.DocRefService
getInfo
-
-
-
-
Constructor Detail
-
DocRefServiceHttpClient
public DocRefServiceHttpClient(java.lang.String type, java.lang.Class<T> docRefEntityClass, java.lang.String baseUrl)
-
-
Method Detail
-
close
public void close()
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
-
getType
public java.lang.String getType()
Description copied from interface:DocRefService
Get the doc ref type that this service wraps.- Specified by:
getType
in interfaceDocRefService<T extends DocRefEntity>
- Returns:
- The doc ref type name
-
getAll
public java.util.List<T> getAll(ServiceUser user) throws QueryApiException
Description copied from interface:DocRefService
Retrieve all of the index entities currently registered- Specified by:
getAll
in interfaceDocRefService<T extends DocRefEntity>
- Parameters:
user
- The logged in user- Returns:
- The list of all known index entities
- Throws:
QueryApiException
- if anything goes wrong
-
get
public java.util.Optional<T> get(ServiceUser user, java.lang.String uuid) throws QueryApiException
Description copied from interface:DocRefService
Retrieve the full config for the given DocRef- Specified by:
get
in interfaceDocRefService<T extends DocRefEntity>
- Parameters:
user
- The logged in useruuid
- The UUID of the docRef to return- Returns:
- The full implementation specific config for this docRef.
- Throws:
QueryApiException
- if anything goes wrong
-
createDocument
public java.util.Optional<T> createDocument(ServiceUser user, java.lang.String uuid, java.lang.String name) throws QueryApiException
Description copied from interface:DocRefService
A new document has been created in Stroom- Specified by:
createDocument
in interfaceDocRefService<T extends DocRefEntity>
- Parameters:
user
- The logged in useruuid
- The UUID of the document as created by stroomname
- The name of the document to be created.- Returns:
- The new index entity
- Throws:
QueryApiException
- if anything goes wrong
-
update
public java.util.Optional<T> update(ServiceUser user, java.lang.String uuid, T updatedConfig) throws QueryApiException
Description copied from interface:DocRefService
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- Specified by:
update
in interfaceDocRefService<T extends DocRefEntity>
- Parameters:
user
- The logged in useruuid
- The UUID of DocRef used to store the index configurationupdatedConfig
- The updated configuration- Returns:
- The updated config
- Throws:
QueryApiException
- if anything goes wrong
-
copyDocument
public java.util.Optional<T> copyDocument(ServiceUser user, java.lang.String originalUuid, java.lang.String copyUuid) throws QueryApiException
Description copied from interface:DocRefService
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 interfaceDocRefService<T extends DocRefEntity>
- Parameters:
user
- The logged in useroriginalUuid
- The uuid of the document being copiedcopyUuid
- The uuid of the copy- Returns:
- The new index entity
- Throws:
QueryApiException
- if anything goes wrong
-
moveDocument
public java.util.Optional<T> moveDocument(ServiceUser user, java.lang.String uuid) throws QueryApiException
Description copied from interface:DocRefService
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 interfaceDocRefService<T extends DocRefEntity>
- Parameters:
user
- The logged in useruuid
- The uuid of the document that was moved- Returns:
- The updated index entity
- Throws:
QueryApiException
- if anything goes wrong
-
renameDocument
public java.util.Optional<T> renameDocument(ServiceUser user, java.lang.String uuid, java.lang.String name) throws QueryApiException
Description copied from interface:DocRefService
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 interfaceDocRefService<T extends DocRefEntity>
- Parameters:
user
- The logged in useruuid
- 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
public java.util.Optional<java.lang.Boolean> deleteDocument(ServiceUser user, java.lang.String uuid) throws QueryApiException
Description copied from interface:DocRefService
The document with this UUID is being deleted in Stroom.- Specified by:
deleteDocument
in interfaceDocRefService<T extends DocRefEntity>
- Parameters:
user
- The logged in useruuid
- 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
public ExportDTO exportDocument(ServiceUser user, java.lang.String uuid) throws QueryApiException
Description copied from interface:DocRefService
Used to export the full details of a document for transfer.- Specified by:
exportDocument
in interfaceDocRefService<T extends DocRefEntity>
- Parameters:
user
- The logged in useruuid
- The UUID of the document to export- Returns:
- The exported data
- Throws:
QueryApiException
- if anything goes wrong
-
importDocument
public 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
Description copied from interface:DocRefService
Used to import a document into the system- Specified by:
importDocument
in interfaceDocRefService<T extends DocRefEntity>
- Parameters:
user
- The logged in useruuid
- The UUID of the document to importname
- The Name of the document to importconfirmed
- Used to indicate if this is a dry rundataMap
- The data that gives all the implementation specific details- Returns:
- The imported document
- Throws:
QueryApiException
- if anything goes wrong
-
-