Package fr.gouv.vitam.metadata.client
Interface MetaDataClient
-
- All Superinterfaces:
java.lang.AutoCloseable
,BasicClient
,MockOrRestClient
,VitamAutoCloseable
- All Known Implementing Classes:
MetaDataClientMock
,MetaDataClientRest
public interface MetaDataClient extends BasicClient
Metadata client interface
-
-
Field Summary
-
Fields inherited from interface fr.gouv.vitam.common.client.BasicClient
STATUS_URL
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description RequestResponse<com.fasterxml.jackson.databind.JsonNode>
atomicUpdateBulk(java.util.List<com.fasterxml.jackson.databind.JsonNode> updateQueries)
Bulk Update units by a list of update query (DSL)GraphComputeResponse
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 timesGraphComputeResponse
computeGraph(GraphComputeResponse.GraphComputeAction action, java.util.Set<java.lang.String> ids)
Compute graph of all document match ids.com.fasterxml.jackson.databind.JsonNode
createAccessionRegisterSymbolic()
Creates the AccessionRegisterSymbolics from ElasticSearch aggregations and nested aggregation request.void
deleteObjectGroupBulk(java.util.Collection<java.lang.String> listIds)
Delete Object Group Bulkvoid
deleteUnitsBulk(java.util.Collection<java.lang.String> listIds)
delete UnitsBulkvoid
exportReclassificationChildNodes(java.util.Set<java.lang.String> ids, java.lang.String unitsToUpdateJsonLineFileName, java.lang.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(java.lang.String objectGroupId)
Search object group by path unit idRequestResponse<com.fasterxml.jackson.databind.JsonNode>
getObjectGroupsByIdsRaw(java.util.Collection<java.lang.String> objectGroupIds)
Select raw object group by idsRequestResponse<com.fasterxml.jackson.databind.JsonNode>
getUnitByIdRaw(java.lang.String unitId)
Search units by path unit idRequestResponse<com.fasterxml.jackson.databind.JsonNode>
getUnitsByIdsRaw(java.util.Collection<java.lang.String> unitIds)
Select raw unis by idscom.fasterxml.jackson.databind.JsonNode
insertObjectGroup(com.fasterxml.jackson.databind.JsonNode insertQuery)
com.fasterxml.jackson.databind.JsonNode
insertObjectGroups(java.util.List<com.fasterxml.jackson.databind.JsonNode> insertQuery)
com.fasterxml.jackson.databind.JsonNode
insertUnitBulk(BulkUnitInsertRequest request)
boolean
refreshObjectGroups()
boolean
refreshUnits()
com.fasterxml.jackson.databind.JsonNode
reindex(IndexParameters indexParam)
Reindex a collection with parametersjava.util.List<ObjectGroupPerOriginatingAgency>
selectAccessionRegisterOnObjectByOperationId(java.lang.String operationId)
java.util.List<UnitPerOriginatingAgency>
selectAccessionRegisterOnUnitByOperationId(java.lang.String operationId)
com.fasterxml.jackson.databind.JsonNode
selectObjectGroups(com.fasterxml.jackson.databind.JsonNode selectQuery)
Search objectgroups by select query (DSL)com.fasterxml.jackson.databind.JsonNode
selectObjectGrouptbyId(com.fasterxml.jackson.databind.JsonNode selectQuery, java.lang.String objectGroupId)
Search Object Group by query (DSL) and path objectGroup idcom.fasterxml.jackson.databind.JsonNode
selectUnitbyId(com.fasterxml.jackson.databind.JsonNode selectQuery, java.lang.String unitId)
Search units by query (DSL) and path unit idcom.fasterxml.jackson.databind.JsonNode
selectUnits(com.fasterxml.jackson.databind.JsonNode selectQuery)
Search units by select query (DSL)java.util.List<RequestResponseOK<com.fasterxml.jackson.databind.JsonNode>>
selectUnitsBulk(java.util.List<com.fasterxml.jackson.databind.JsonNode> selectQueryBulk)
Bulk Search units by a list of select query (DSL)com.fasterxml.jackson.databind.JsonNode
selectUnitsWithInheritedRules(com.fasterxml.jackson.databind.JsonNode selectQuery)
Select units with inherited rules by select query (DSL)SwitchIndexResult
switchIndexes(SwitchIndexParameters switchIndexParam)
Switch indexesvoid
updateObjectGroupById(com.fasterxml.jackson.databind.JsonNode updateQuery, java.lang.String objectGroupId)
Update ObjectGroupRequestResponse<com.fasterxml.jackson.databind.JsonNode>
updateUnitBulk(com.fasterxml.jackson.databind.JsonNode updateQuery)
Update units Bulk.com.fasterxml.jackson.databind.JsonNode
updateUnitById(com.fasterxml.jackson.databind.JsonNode updateQuery, java.lang.String unitId)
Update units by query (DSL) and path unit idRequestResponse<com.fasterxml.jackson.databind.JsonNode>
updateUnitsRulesBulk(java.util.List<java.lang.String> unitsIds, RuleActions actions, java.util.Map<java.lang.String,DurationData> rulesToDurationData)
Update units rules Bulk.-
Methods inherited from interface fr.gouv.vitam.common.client.MockOrRestClient
checkStatus, checkStatus, close, consumeAnyEntityAndClose, getResourcePath, getServiceUrl
-
-
-
-
Method Detail
-
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 querySelectMultiQuery
as String
Null is not allowed- Returns:
- Json object {$hint:{},$result:[{},{}]}
- Throws:
MetaDataExecutionException
- thrown when internal Server Error (fatal technical exception thrown)InvalidParseOperationException
MetaDataDocumentSizeException
- thrown when Query document Size is Too LargeMetaDataClientServerException
-
selectUnitsBulk
java.util.List<RequestResponseOK<com.fasterxml.jackson.databind.JsonNode>> selectUnitsBulk(java.util.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 SelectMultiQuery
as 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)InvalidParseOperationException
MetaDataDocumentSizeException
- thrown when Query document Size is Too LargeMetaDataClientServerException
-
selectUnitbyId
com.fasterxml.jackson.databind.JsonNode selectUnitbyId(com.fasterxml.jackson.databind.JsonNode selectQuery, java.lang.String unitId) throws MetaDataExecutionException, MetaDataDocumentSizeException, InvalidParseOperationException, MetaDataClientServerException
Search units by query (DSL) and path unit id- Parameters:
selectQuery
- : select querySelect
as 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)InvalidParseOperationException
MetaDataDocumentSizeException
- thrown when Query document Size is Too LargeMetaDataClientServerException
-
selectObjectGrouptbyId
com.fasterxml.jackson.databind.JsonNode selectObjectGrouptbyId(com.fasterxml.jackson.databind.JsonNode selectQuery, java.lang.String objectGroupId) throws MetaDataExecutionException, MetaDataNotFoundException, MetaDataDocumentSizeException, InvalidParseOperationException, MetadataInvalidSelectException, MetaDataClientServerException
Search Object Group by query (DSL) and path objectGroup id- Parameters:
selectQuery
- : select querySelect
as 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 LargeMetaDataNotFoundException
MetadataInvalidSelectException
- thrown when objectGroupId or selectQuery id is null or blankMetaDataClientServerException
-
updateUnitById
com.fasterxml.jackson.databind.JsonNode updateUnitById(com.fasterxml.jackson.databind.JsonNode updateQuery, java.lang.String unitId) throws MetaDataNotFoundException, MetaDataExecutionException, MetaDataDocumentSizeException, InvalidParseOperationException, MetaDataClientServerException
Update units by query (DSL) and path unit id- Parameters:
updateQuery
- update querySelect
as 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)InvalidParseOperationException
MetaDataDocumentSizeException
- thrown when Query document Size is Too LargeMetaDataNotFoundException
MetaDataClientServerException
-
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:
InvalidParseOperationException
MetaDataExecutionException
MetaDataNotFoundException
MetaDataDocumentSizeException
MetaDataClientServerException
-
updateObjectGroupById
void updateObjectGroupById(com.fasterxml.jackson.databind.JsonNode updateQuery, java.lang.String objectGroupId) throws InvalidParseOperationException, MetaDataClientServerException, MetaDataExecutionException
Update ObjectGroup- Parameters:
updateQuery
-objectGroupId
-- Throws:
InvalidParseOperationException
MetaDataClientServerException
MetaDataExecutionException
-
insertObjectGroups
com.fasterxml.jackson.databind.JsonNode insertObjectGroups(java.util.List<com.fasterxml.jackson.databind.JsonNode> insertQuery) throws InvalidParseOperationException, MetaDataExecutionException, MetaDataNotFoundException, MetaDataDocumentSizeException, MetaDataClientServerException
-
selectAccessionRegisterOnUnitByOperationId
java.util.List<UnitPerOriginatingAgency> selectAccessionRegisterOnUnitByOperationId(java.lang.String operationId) throws MetaDataClientServerException
- Parameters:
operationId
-- Returns:
- the list of UnitsPerOriginatingAgency
- Throws:
MetaDataClientServerException
-
selectAccessionRegisterOnObjectByOperationId
java.util.List<ObjectGroupPerOriginatingAgency> selectAccessionRegisterOnObjectByOperationId(java.lang.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 querySelectMultiQuery
as String
Null is not allowed- Returns:
- Json object {$hint:{},$result:[{},{}]}
- Throws:
MetaDataExecutionException
- thrown when internal Server Error (fatal technical exception thrown)InvalidParseOperationException
MetaDataDocumentSizeException
- thrown when Query document Size is Too LargeMetaDataClientServerException
-
refreshUnits
boolean refreshUnits() throws MetaDataClientServerException
- Returns:
- True if the Units index is refreshed
- Throws:
MetaDataClientServerException
-
refreshObjectGroups
boolean refreshObjectGroups() throws MetaDataClientServerException
- 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:
MetaDataClientServerException
MetaDataNotFoundException
- 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:
MetaDataClientServerException
MetaDataNotFoundException
- in case the index does not existInvalidParseOperationException
-
getUnitByIdRaw
RequestResponse<com.fasterxml.jackson.databind.JsonNode> getUnitByIdRaw(java.lang.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(java.util.Collection<java.lang.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(java.lang.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(java.util.Collection<java.lang.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, java.util.Set<java.lang.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
-
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:
InvalidParseOperationException
MetaDataExecutionException
MetaDataNotFoundException
MetaDataDocumentSizeException
MetaDataClientServerException
-
atomicUpdateBulk
RequestResponse<com.fasterxml.jackson.databind.JsonNode> atomicUpdateBulk(java.util.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 queryUpdateMultiQuery
as 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:
InvalidParseOperationException
MetaDataExecutionException
MetaDataNotFoundException
MetaDataDocumentSizeException
MetaDataClientServerException
-
updateUnitsRulesBulk
RequestResponse<com.fasterxml.jackson.databind.JsonNode> updateUnitsRulesBulk(java.util.List<java.lang.String> unitsIds, RuleActions actions, java.util.Map<java.lang.String,DurationData> rulesToDurationData) throws InvalidParseOperationException, MetaDataExecutionException, MetaDataNotFoundException, MetaDataDocumentSizeException, MetaDataClientServerException
Update units rules Bulk.- Parameters:
unitsIds
- the bulk unit ids to updateactions
-- Returns:
- Throws:
InvalidParseOperationException
MetaDataExecutionException
MetaDataNotFoundException
MetaDataDocumentSizeException
MetaDataClientServerException
-
exportReclassificationChildNodes
void exportReclassificationChildNodes(java.util.Set<java.lang.String> ids, java.lang.String unitsToUpdateJsonLineFileName, java.lang.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:
VitamClientException
MetaDataExecutionException
-
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:
InvalidParseOperationException
MetaDataDocumentSizeException
- thrown when Query document Size is Too LargeMetaDataClientServerException
MetaDataExecutionException
-
createAccessionRegisterSymbolic
com.fasterxml.jackson.databind.JsonNode createAccessionRegisterSymbolic() throws MetaDataClientServerException, MetaDataExecutionException
Creates 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:
MetaDataClientServerException
MetaDataExecutionException
-
deleteUnitsBulk
void deleteUnitsBulk(java.util.Collection<java.lang.String> listIds) throws MetaDataExecutionException, MetaDataClientServerException
delete UnitsBulk- Parameters:
listIds
- list of id to delete- Throws:
MetaDataExecutionException
- MetaDataExecutionExceptionMetaDataClientServerException
- MetaDataClientServerException
-
deleteObjectGroupBulk
void deleteObjectGroupBulk(java.util.Collection<java.lang.String> listIds) throws MetaDataExecutionException, InvalidParseOperationException, MetaDataClientServerException
Delete Object Group Bulk- Parameters:
listIds
- list of id to delete- Throws:
MetaDataExecutionException
- MetaDataExecutionExceptionMetaDataClientServerException
- MetaDataClientServerExceptionInvalidParseOperationException
-
-