Package fr.gouv.vitam.metadata.client
Interface MetaDataClient
- All Superinterfaces:
AutoCloseable,BasicClient,MockOrRestClient,VitamAutoCloseable
- All Known Implementing Classes:
MetaDataClientMock,MetaDataClientRest
Metadata client interface
-
Field Summary
Fields inherited from interface fr.gouv.vitam.common.client.BasicClient
STATUS_URL -
Method Summary
Modifier and TypeMethodDescriptionRequestResponse<com.fasterxml.jackson.databind.JsonNode>atomicUpdateBulk(List<com.fasterxml.jackson.databind.JsonNode> updateQueries) Bulk Update units by a list of update query (DSL)javax.ws.rs.core.ResponseclearESScrollFilter(String scrollId) computeGraph(com.fasterxml.jackson.databind.JsonNode queryDsl) Compute graph of all Units/Got that match the given query dsl The returned number of treated object group is an estimation, as object group can be computed several timescomputeGraph(GraphComputeResponse.GraphComputeAction action, Set<String> ids) Compute graph of all document match ids.com.fasterxml.jackson.databind.JsonNodeCreates the AccessionRegisterSymbolics from ElasticSearch aggregations and nested aggregation request.voiddeleteObjectGroupBulk(Collection<String> listIds) Delete Object Group BulkvoiddeleteUnitsBulk(Collection<String> listIds) delete UnitsBulkvoidexportReclassificationChildNodes(Set<String> ids, String unitsToUpdateJsonLineFileName, String objectGroupsToUpdateJsonLineFileName) Export all units and object groups that are a descendants of the provided units to workspace for graph update.RequestResponse<com.fasterxml.jackson.databind.JsonNode>getObjectGroupByIdRaw(String objectGroupId) Search object group by path unit idRequestResponse<com.fasterxml.jackson.databind.JsonNode>getObjectGroupsByIdsRaw(Collection<String> objectGroupIds) Select raw object group by idscom.fasterxml.jackson.databind.JsonNodegetPurgedPersistentIdentifiers(String persistentIdentifier, PurgedCollectionType type) RequestResponse<com.fasterxml.jackson.databind.JsonNode>getUnitByIdRaw(String unitId) Search units by path unit idRequestResponse<com.fasterxml.jackson.databind.JsonNode>getUnitsByIdsRaw(Collection<String> unitIds) Select raw unis by idscom.fasterxml.jackson.databind.JsonNodeinsertObjectGroup(com.fasterxml.jackson.databind.JsonNode insertQuery) com.fasterxml.jackson.databind.JsonNodeinsertObjectGroups(List<com.fasterxml.jackson.databind.JsonNode> insertQuery) com.fasterxml.jackson.databind.JsonNodeinsertUnitBulk(BulkUnitInsertRequest request) javax.ws.rs.core.ResponseAPI to process obsolete compute inherited rules service for metadatas.javax.ws.rs.core.ResponseAPI to process purge expired DIP files service for metadatas.javax.ws.rs.core.ResponseAPI to process purge expired tranfering SIP files service for metadatas.reconstructCollection(List<ReconstructionRequestItem> reconstructionItems) API to access and launch the Vitam reconstruction service for metadatas.RequestResponse<com.fasterxml.jackson.databind.JsonNode>Reconstruct Persistent Identifiersbooleanbooleancom.fasterxml.jackson.databind.JsonNodereindex(IndexParameters indexParam) Reindex a collection with parametersjavax.ws.rs.core.ResponseAPI to process audit data consistency Mongo and ES service for metadatas.selectAccessionRegisterOnObjectByOperationId(String operationId) selectAccessionRegisterOnUnitByOperationId(String operationId) com.fasterxml.jackson.databind.JsonNodeselectObjectGroups(com.fasterxml.jackson.databind.JsonNode selectQuery) Search objectgroups by select query (DSL)com.fasterxml.jackson.databind.JsonNodeselectObjectGrouptbyId(com.fasterxml.jackson.databind.JsonNode selectQuery, String objectGroupId) Search Object Group by query (DSL) and path objectGroup idcom.fasterxml.jackson.databind.JsonNodeselectUnitbyId(com.fasterxml.jackson.databind.JsonNode selectQuery, String unitId) Search units by query (DSL) and path unit idcom.fasterxml.jackson.databind.JsonNodeselectUnits(com.fasterxml.jackson.databind.JsonNode selectQuery) Search units by select query (DSL)List<RequestResponseOK<com.fasterxml.jackson.databind.JsonNode>>selectUnitsBulk(List<com.fasterxml.jackson.databind.JsonNode> selectQueryBulk) Bulk Search units by a list of select query (DSL)com.fasterxml.jackson.databind.JsonNodeselectUnitsWithInheritedRules(com.fasterxml.jackson.databind.JsonNode selectQuery) Select units with inherited rules by select query (DSL)javax.ws.rs.core.ResponseAPI to access and launch the Vitam store graph service for metadatas.javax.ws.rs.core.ResponsestreamObjects(com.fasterxml.jackson.databind.JsonNode selectQuery) javax.ws.rs.core.ResponsestreamUnits(com.fasterxml.jackson.databind.JsonNode selectQuery) switchIndexes(SwitchIndexParameters switchIndexParam) Switch indexesvoidupdateObjectGroupById(com.fasterxml.jackson.databind.JsonNode updateQuery, String objectGroupId) Update ObjectGroupRequestResponse<com.fasterxml.jackson.databind.JsonNode>updateUnitBulk(com.fasterxml.jackson.databind.JsonNode updateQuery) Update units Bulk.com.fasterxml.jackson.databind.JsonNodeupdateUnitById(com.fasterxml.jackson.databind.JsonNode updateQuery, String unitId) Update units by query (DSL) and path unit idRequestResponse<com.fasterxml.jackson.databind.JsonNode>updateUnitsRulesBulk(List<String> unitsIds, RuleActions actions, Map<String, DurationData> rulesToDurationData) Update units rules Bulk.Methods inherited from interface fr.gouv.vitam.common.client.MockOrRestClient
checkStatus, checkStatus, close, consumeAnyEntityAndClose, getResourcePath, getServiceUrl
-
Method Details
-
insertUnitBulk
com.fasterxml.jackson.databind.JsonNode insertUnitBulk(BulkUnitInsertRequest request) throws InvalidParseOperationException, MetaDataExecutionException, MetaDataNotFoundException, MetaDataDocumentSizeException, MetaDataClientServerException -
selectUnits
com.fasterxml.jackson.databind.JsonNode selectUnits(com.fasterxml.jackson.databind.JsonNode selectQuery) throws MetaDataExecutionException, MetaDataDocumentSizeException, InvalidParseOperationException, MetaDataClientServerException Search units by select query (DSL)- Parameters:
selectQuery- : select querySelectMultiQueryas String
Null is not allowed- Returns:
- Json object {$hint:{},$result:[{},{}]}
- Throws:
MetaDataExecutionException- thrown when internal Server Error (fatal technical exception thrown)InvalidParseOperationExceptionMetaDataDocumentSizeException- thrown when Query document Size is Too LargeMetaDataClientServerException
-
selectUnitsBulk
List<RequestResponseOK<com.fasterxml.jackson.databind.JsonNode>> selectUnitsBulk(List<com.fasterxml.jackson.databind.JsonNode> selectQueryBulk) throws MetaDataExecutionException, MetaDataDocumentSizeException, InvalidParseOperationException, MetaDataClientServerException Bulk Search units by a list of select query (DSL)- Parameters:
List-: select query SelectMultiQueryas String
Null is not allowed
List can be empty- Returns:
- RequestResponse object {$hint:{},$result:[{},{}]} containing a list of RequestResponse (RequestResponseOK or VitamError) as JsonNode linked to each selectQuery
- Throws:
MetaDataExecutionException- thrown when internal Server Error (fatal technical exception thrown)InvalidParseOperationExceptionMetaDataDocumentSizeException- thrown when Query document Size is Too LargeMetaDataClientServerException
-
selectUnitbyId
com.fasterxml.jackson.databind.JsonNode selectUnitbyId(com.fasterxml.jackson.databind.JsonNode selectQuery, String unitId) throws MetaDataExecutionException, MetaDataDocumentSizeException, InvalidParseOperationException, MetaDataClientServerException Search units by query (DSL) and path unit id- Parameters:
selectQuery- : select querySelectas JsonNode
Null is not allowedunitId- : unit id
null and blank is not allowed- Returns:
- Json object {$hint:{},$result:[{},{}]}
- Throws:
MetaDataExecutionException- thrown when internal Server Error (fatal technical exception thrown)InvalidParseOperationExceptionMetaDataDocumentSizeException- thrown when Query document Size is Too LargeMetaDataClientServerException
-
selectObjectGrouptbyId
com.fasterxml.jackson.databind.JsonNode selectObjectGrouptbyId(com.fasterxml.jackson.databind.JsonNode selectQuery, String objectGroupId) throws MetaDataExecutionException, MetaDataNotFoundException, MetaDataDocumentSizeException, InvalidParseOperationException, MetadataInvalidSelectException, MetaDataClientServerException Search Object Group by query (DSL) and path objectGroup id- Parameters:
selectQuery- : select querySelectas JsonNode
Null is not allowedobjectGroupId- : objectGroup id
null and blank is not allowed- Returns:
- Json object {$hint:{},$result:[{},{}]}
- Throws:
MetaDataExecutionException- thrown when internal Server Error (fatal technical exception thrown)InvalidParseOperationException- thrown when the Query is badly formatted or objectGroupId is emptyMetaDataDocumentSizeException- thrown when Query document Size is Too LargeMetaDataNotFoundExceptionMetadataInvalidSelectException- thrown when objectGroupId or selectQuery id is null or blankMetaDataClientServerException
-
updateUnitById
com.fasterxml.jackson.databind.JsonNode updateUnitById(com.fasterxml.jackson.databind.JsonNode updateQuery, String unitId) throws MetaDataNotFoundException, MetaDataExecutionException, MetaDataDocumentSizeException, InvalidParseOperationException, MetaDataClientServerException Update units by query (DSL) and path unit id- Parameters:
updateQuery- update querySelectas JsonNode
Null is not allowedunitId- unit id
null and blank is not allowed- Returns:
- Json object {$hint:{},$result:[{},{}]}
- Throws:
MetaDataExecutionException- thrown when internal Server Error (fatal technical exception thrown)InvalidParseOperationExceptionMetaDataDocumentSizeException- thrown when Query document Size is Too LargeMetaDataNotFoundExceptionMetaDataClientServerException
-
insertObjectGroup
com.fasterxml.jackson.databind.JsonNode insertObjectGroup(com.fasterxml.jackson.databind.JsonNode insertQuery) throws InvalidParseOperationException, MetaDataExecutionException, MetaDataNotFoundException, MetaDataDocumentSizeException, MetaDataClientServerException - Parameters:
insertQuery- as String- Returns:
- response as JsonNode contains the request result
- Throws:
InvalidParseOperationExceptionMetaDataExecutionExceptionMetaDataNotFoundExceptionMetaDataDocumentSizeExceptionMetaDataClientServerException
-
updateObjectGroupById
void updateObjectGroupById(com.fasterxml.jackson.databind.JsonNode updateQuery, String objectGroupId) throws InvalidParseOperationException, MetaDataClientServerException, MetaDataExecutionException Update ObjectGroup- Parameters:
updateQuery-objectGroupId-- Throws:
InvalidParseOperationExceptionMetaDataClientServerExceptionMetaDataExecutionException
-
insertObjectGroups
com.fasterxml.jackson.databind.JsonNode insertObjectGroups(List<com.fasterxml.jackson.databind.JsonNode> insertQuery) throws InvalidParseOperationException, MetaDataExecutionException, MetaDataNotFoundException, MetaDataDocumentSizeException, MetaDataClientServerException -
selectAccessionRegisterOnUnitByOperationId
List<UnitPerOriginatingAgency> selectAccessionRegisterOnUnitByOperationId(String operationId) throws MetaDataClientServerException - Parameters:
operationId-- Returns:
- the list of UnitsPerOriginatingAgency
- Throws:
MetaDataClientServerException
-
selectAccessionRegisterOnObjectByOperationId
List<ObjectGroupPerOriginatingAgency> selectAccessionRegisterOnObjectByOperationId(String operationId) throws MetaDataClientServerException - Parameters:
operationId-- Returns:
- the list of ObjectGroupPerOriginatingAgency
- Throws:
MetaDataClientServerException
-
selectObjectGroups
com.fasterxml.jackson.databind.JsonNode selectObjectGroups(com.fasterxml.jackson.databind.JsonNode selectQuery) throws MetaDataExecutionException, MetaDataDocumentSizeException, InvalidParseOperationException, MetaDataClientServerException Search objectgroups by select query (DSL)- Parameters:
selectQuery- : select querySelectMultiQueryas String
Null is not allowed- Returns:
- Json object {$hint:{},$result:[{},{}]}
- Throws:
MetaDataExecutionException- thrown when internal Server Error (fatal technical exception thrown)InvalidParseOperationExceptionMetaDataDocumentSizeException- thrown when Query document Size is Too LargeMetaDataClientServerException
-
refreshUnits
- Returns:
- True if the Units index is refreshed
- Throws:
MetaDataClientServerException
-
refreshObjectGroups
- Returns:
- True if the ObjectGroups index is refreshed
- Throws:
MetaDataClientServerException
-
reindex
com.fasterxml.jackson.databind.JsonNode reindex(IndexParameters indexParam) throws InvalidParseOperationException, MetaDataClientServerException, MetaDataNotFoundException Reindex a collection with parameters- Parameters:
indexParam- reindexation parameters- Returns:
- JsonObject containing information about the newly created index
- Throws:
MetaDataClientServerExceptionMetaDataNotFoundException- in case the index does not existInvalidParseOperationException
-
switchIndexes
SwitchIndexResult switchIndexes(SwitchIndexParameters switchIndexParam) throws InvalidParseOperationException, MetaDataClientServerException, MetaDataNotFoundException Switch indexes- Parameters:
switchIndexParam- switch index parameters- Returns:
- JsonObject containing information about the newly created index
- Throws:
MetaDataClientServerExceptionMetaDataNotFoundException- in case the index does not existInvalidParseOperationException
-
getUnitByIdRaw
RequestResponse<com.fasterxml.jackson.databind.JsonNode> getUnitByIdRaw(String unitId) throws VitamClientException Search units by path unit id- Parameters:
unitId- : unit id
null and blank is not allowed- Returns:
- Json object {$hint:{},$result:[{}]} or vitam error
- Throws:
VitamClientException
-
getUnitsByIdsRaw
RequestResponse<com.fasterxml.jackson.databind.JsonNode> getUnitsByIdsRaw(Collection<String> unitIds) throws VitamClientException Select raw unis by ids- Parameters:
unitIds- : unit ids
null and blank is not allowed- Returns:
- Json object {$hint:{},$result:[{}]} or vitam error
- Throws:
VitamClientException
-
getObjectGroupByIdRaw
RequestResponse<com.fasterxml.jackson.databind.JsonNode> getObjectGroupByIdRaw(String objectGroupId) throws VitamClientException Search object group by path unit id- Parameters:
objectGroupId- : objectGroup id
null and blank is not allowed- Returns:
- Json object {$hint:{},$result:[{}]} or vitam error
- Throws:
VitamClientException
-
getObjectGroupsByIdsRaw
RequestResponse<com.fasterxml.jackson.databind.JsonNode> getObjectGroupsByIdsRaw(Collection<String> objectGroupIds) throws VitamClientException Select raw object group by ids- Parameters:
objectGroupIds- : object group ids
null and blank is not allowed- Returns:
- Json object {$hint:{},$result:[{}]} or vitam error
- Throws:
VitamClientException
-
computeGraph
GraphComputeResponse computeGraph(com.fasterxml.jackson.databind.JsonNode queryDsl) throws VitamClientException Compute graph of all Units/Got that match the given query dsl The returned number of treated object group is an estimation, as object group can be computed several times- Parameters:
queryDsl-- Returns:
- GraphComputeResponse
- Throws:
VitamClientException
-
computeGraph
GraphComputeResponse computeGraph(GraphComputeResponse.GraphComputeAction action, Set<String> ids) throws VitamClientException Compute graph of all document match ids. The document can be UNIT, OBJECTGROUP, or UNIT AND OBJECTGROUP In case of UNIT AND OBJECTGROUP, the ids set is id of UNITs- Parameters:
action-ids-- Returns:
- GraphComputeResponse
- Throws:
VitamClientException
-
reconstructPersistentIdentifiers
RequestResponse<com.fasterxml.jackson.databind.JsonNode> reconstructPersistentIdentifiers(PersistentIdentifierReconstructionRequest requestItem) throws MetaDataNotFoundException, InvalidParseOperationException, MetaDataClientServerException Reconstruct Persistent Identifiers- Parameters:
requestItem-- Returns:
- Throws:
MetaDataNotFoundExceptionInvalidParseOperationExceptionMetaDataClientServerException
-
getPurgedPersistentIdentifiers
com.fasterxml.jackson.databind.JsonNode getPurgedPersistentIdentifiers(String persistentIdentifier, @Nullable PurgedCollectionType type) throws MetaDataNotFoundException, InvalidParseOperationException, MetaDataClientServerException -
updateUnitBulk
RequestResponse<com.fasterxml.jackson.databind.JsonNode> updateUnitBulk(com.fasterxml.jackson.databind.JsonNode updateQuery) throws InvalidParseOperationException, MetaDataExecutionException, MetaDataNotFoundException, MetaDataDocumentSizeException, MetaDataClientServerException Update units Bulk.- Parameters:
updateQuery-- Returns:
- Throws:
InvalidParseOperationExceptionMetaDataExecutionExceptionMetaDataNotFoundExceptionMetaDataDocumentSizeExceptionMetaDataClientServerException
-
atomicUpdateBulk
RequestResponse<com.fasterxml.jackson.databind.JsonNode> atomicUpdateBulk(List<com.fasterxml.jackson.databind.JsonNode> updateQueries) throws InvalidParseOperationException, MetaDataExecutionException, MetaDataNotFoundException, MetaDataDocumentSizeException, MetaDataClientServerException Bulk Update units by a list of update query (DSL)- Parameters:
updateQueries- : update queryUpdateMultiQueryas String Null is not allowed List can be empty- Returns:
- RequestResponse object {$hint:{},$result:[{},{}]} containing a list of RequestResponse (RequestResponseOK or VitamError) as JsonNode linked to each updateQuery
- Throws:
InvalidParseOperationExceptionMetaDataExecutionExceptionMetaDataNotFoundExceptionMetaDataDocumentSizeExceptionMetaDataClientServerException
-
updateUnitsRulesBulk
RequestResponse<com.fasterxml.jackson.databind.JsonNode> updateUnitsRulesBulk(List<String> unitsIds, RuleActions actions, Map<String, DurationData> rulesToDurationData) throws InvalidParseOperationException, MetaDataExecutionException, MetaDataNotFoundException, MetaDataDocumentSizeException, MetaDataClientServerExceptionUpdate units rules Bulk.- Parameters:
unitsIds- the bulk unit ids to updateactions-- Returns:
- Throws:
InvalidParseOperationExceptionMetaDataExecutionExceptionMetaDataNotFoundExceptionMetaDataDocumentSizeExceptionMetaDataClientServerException
-
exportReclassificationChildNodes
void exportReclassificationChildNodes(Set<String> ids, String unitsToUpdateJsonLineFileName, String objectGroupsToUpdateJsonLineFileName) throws VitamClientException, MetaDataExecutionException Export all units and object groups that are a descendants of the provided units to workspace for graph update.- Parameters:
ids- the unit ids for which all descendant nodes (units and object groups) are to be updated.- Throws:
VitamClientExceptionMetaDataExecutionException
-
selectUnitsWithInheritedRules
com.fasterxml.jackson.databind.JsonNode selectUnitsWithInheritedRules(com.fasterxml.jackson.databind.JsonNode selectQuery) throws MetaDataDocumentSizeException, InvalidParseOperationException, MetaDataClientServerException, MetaDataExecutionException Select units with inherited rules by select query (DSL)- Parameters:
selectQuery- : select query- Returns:
- Json object
- Throws:
InvalidParseOperationExceptionMetaDataDocumentSizeException- thrown when Query document Size is Too LargeMetaDataClientServerExceptionMetaDataExecutionException
-
createAccessionRegisterSymbolic
com.fasterxml.jackson.databind.JsonNode createAccessionRegisterSymbolic() throws MetaDataClientServerException, MetaDataExecutionExceptionCreates the AccessionRegisterSymbolics from ElasticSearch aggregations and nested aggregation request. Because the AccessionRegisterSymbolic is not available from this package, it is a JsonNode which is returned.- Returns:
- a list of AccessionRegisterSymbolic as JsonNode
- Throws:
MetaDataClientServerExceptionMetaDataExecutionException
-
deleteUnitsBulk
void deleteUnitsBulk(Collection<String> listIds) throws MetaDataExecutionException, MetaDataClientServerException delete UnitsBulk- Parameters:
listIds- list of id to delete- Throws:
MetaDataExecutionException- MetaDataExecutionExceptionMetaDataClientServerException- MetaDataClientServerException
-
deleteObjectGroupBulk
void deleteObjectGroupBulk(Collection<String> listIds) throws MetaDataExecutionException, InvalidParseOperationException, MetaDataClientServerException Delete Object Group Bulk- Parameters:
listIds- list of id to delete- Throws:
MetaDataExecutionException- MetaDataExecutionExceptionMetaDataClientServerException- MetaDataClientServerExceptionInvalidParseOperationException
-
storeGraph
javax.ws.rs.core.Response storeGraph() throws MetaDataNotFoundException, MetaDataDocumentSizeException, MetaDataExecutionException, InvalidParseOperationException, MetaDataClientServerExceptionAPI to access and launch the Vitam store graph service for metadatas.- Returns:
- Throws:
MetaDataExecutionException- MetaDataExecutionExceptionMetaDataClientServerException- MetaDataClientServerExceptionMetaDataNotFoundExceptionMetaDataDocumentSizeExceptionInvalidParseOperationException
-
reconstructCollection
List<ReconstructionResponseItem> reconstructCollection(List<ReconstructionRequestItem> reconstructionItems) throws MetaDataNotFoundException, InvalidParseOperationException, MetaDataClientServerException API to access and launch the Vitam reconstruction service for metadatas.- Parameters:
reconstructionItems- list of reconstruction request items- Returns:
- Throws:
MetaDataClientServerException- MetaDataClientServerExceptionMetaDataNotFoundExceptionInvalidParseOperationException
-
processObsoleteComputedInheritedRules
javax.ws.rs.core.Response processObsoleteComputedInheritedRules() throws MetaDataNotFoundException, InvalidParseOperationException, MetaDataClientServerExceptionAPI to process obsolete compute inherited rules service for metadatas.- Returns:
- Throws:
MetaDataClientServerException- MetaDataClientServerException InvalidParseOperationExceptionMetaDataNotFoundExceptionInvalidParseOperationException
-
purgeExpiredDipFiles
javax.ws.rs.core.Response purgeExpiredDipFiles() throws MetaDataNotFoundException, InvalidParseOperationException, MetaDataClientServerExceptionAPI to process purge expired DIP files service for metadatas.- Returns:
- Throws:
MetaDataClientServerException- MetaDataClientServerException InvalidParseOperationExceptionMetaDataNotFoundExceptionInvalidParseOperationException
-
purgeExpiredTransfersSIPFiles
javax.ws.rs.core.Response purgeExpiredTransfersSIPFiles() throws MetaDataNotFoundException, InvalidParseOperationException, MetaDataClientServerExceptionAPI to process purge expired tranfering SIP files service for metadatas.- Returns:
- Throws:
MetaDataClientServerException- MetaDataClientServerException InvalidParseOperationExceptionMetaDataNotFoundExceptionInvalidParseOperationException
-
runAuditDataConsistencyMongoEs
javax.ws.rs.core.Response runAuditDataConsistencyMongoEs() throws MetaDataNotFoundException, InvalidParseOperationException, MetaDataClientServerExceptionAPI to process audit data consistency Mongo and ES service for metadatas.- Returns:
- Throws:
MetaDataClientServerException- MetaDataClientServerException InvalidParseOperationExceptionMetaDataNotFoundExceptionInvalidParseOperationException
-
streamUnits
javax.ws.rs.core.Response streamUnits(com.fasterxml.jackson.databind.JsonNode selectQuery) throws MetaDataClientServerException, MetadataScrollThresholdExceededException, MetadataScrollLimitExceededException -
streamObjects
javax.ws.rs.core.Response streamObjects(com.fasterxml.jackson.databind.JsonNode selectQuery) throws MetaDataClientServerException, MetadataScrollThresholdExceededException, MetadataScrollLimitExceededException -
clearESScrollFilter
- Throws:
MetaDataClientServerException
-