public class MetaDataClientMock extends AbstractMockClient implements MetaDataClient
AbstractMockClient.FakeInboundResponse
INTERNAL_SERVER_ERROR
STATUS_URL
Constructor and Description |
---|
MetaDataClientMock() |
Modifier and Type | Method and Description |
---|---|
GraphComputeResponse |
computeGraph(GraphComputeResponse.GraphComputeAction action,
Set<String> ids)
Compute graph of all document match ids.
|
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 times
|
com.fasterxml.jackson.databind.JsonNode |
createAccessionRegisterSymbolic()
Creates the AccessionRegisterSymbolics from ElasticSearch aggregations and nested aggregation request.
|
void |
deleteObjectGroupBulk(Collection<String> listIds)
Delete Object Group Bulk
|
void |
deleteUnitsBulk(Collection<String> listIds)
delete UnitsBulk
|
void |
exportReclassificationChildNodes(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 id
|
RequestResponse<com.fasterxml.jackson.databind.JsonNode> |
getObjectGroupsByIdsRaw(Collection<String> objectGroupIds)
Select raw object group by ids
|
RequestResponse<com.fasterxml.jackson.databind.JsonNode> |
getUnitByIdRaw(String unitId)
Search units by path unit id
|
RequestResponse<com.fasterxml.jackson.databind.JsonNode> |
getUnitsByIdsRaw(Collection<String> unitIds)
Select raw unis by ids
|
com.fasterxml.jackson.databind.JsonNode |
insertObjectGroup(com.fasterxml.jackson.databind.JsonNode insertQuery) |
com.fasterxml.jackson.databind.JsonNode |
insertObjectGroups(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 parameters
|
List<ObjectGroupPerOriginatingAgency> |
selectAccessionRegisterOnObjectByOperationId(String operationId) |
List<UnitPerOriginatingAgency> |
selectAccessionRegisterOnUnitByOperationId(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,
String objectGroupId)
Search Object Group by query (DSL) and path objectGroup id
|
com.fasterxml.jackson.databind.JsonNode |
selectUnitbyId(com.fasterxml.jackson.databind.JsonNode selectQuery,
String unitId)
Search units by query (DSL) and path unit id
|
com.fasterxml.jackson.databind.JsonNode |
selectUnits(com.fasterxml.jackson.databind.JsonNode selectQuery)
Search units by select query (DSL)
|
com.fasterxml.jackson.databind.JsonNode |
selectUnitsWithInheritedRules(com.fasterxml.jackson.databind.JsonNode selectQuery)
Select units with inherited rules by select query (DSL)
|
javax.ws.rs.core.Response |
startComputeInheritedRules(com.fasterxml.jackson.databind.JsonNode dslQuery) |
com.fasterxml.jackson.databind.JsonNode |
switchIndexes(SwitchIndexParameters switchIndexParam)
Switch indexes
|
void |
updateObjectGroupById(com.fasterxml.jackson.databind.JsonNode objectGroup,
String objectGroupId)
Update ObjectGroup
|
RequestResponse<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,
String unitId)
Update units by query (DSL) and path unit id
|
RequestResponse<com.fasterxml.jackson.databind.JsonNode> |
updateUnitsRulesBulk(List<String> unitsIds,
RuleActions actions,
Map<String,DurationData> rulesToDurationData)
Update units rules Bulk.
|
checkStatus, checkStatus, close, consumeAnyEntityAndClose, getResourcePath, getServiceUrl
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
checkStatus, checkStatus, close, consumeAnyEntityAndClose, getResourcePath, getServiceUrl
public com.fasterxml.jackson.databind.JsonNode insertUnitBulk(BulkUnitInsertRequest request) throws InvalidParseOperationException, MetaDataExecutionException, MetaDataNotFoundException, MetaDataDocumentSizeException, MetaDataClientServerException
public com.fasterxml.jackson.databind.JsonNode selectUnits(com.fasterxml.jackson.databind.JsonNode selectQuery) throws MetaDataExecutionException, MetaDataDocumentSizeException, InvalidParseOperationException, MetaDataClientServerException
MetaDataClient
selectUnits
in interface MetaDataClient
selectQuery
- : select query SelectMultiQuery
as String MetaDataExecutionException
- thrown when internal Server Error (fatal technical exception thrown)MetaDataDocumentSizeException
- thrown when Query document Size is Too LargeInvalidParseOperationException
MetaDataClientServerException
public com.fasterxml.jackson.databind.JsonNode selectUnitbyId(com.fasterxml.jackson.databind.JsonNode selectQuery, String unitId) throws MetaDataExecutionException, MetaDataDocumentSizeException, InvalidParseOperationException, MetaDataClientServerException
MetaDataClient
selectUnitbyId
in interface MetaDataClient
selectQuery
- : select query Select
as JsonNode
unitId
- : unit id MetaDataExecutionException
- thrown when internal Server Error (fatal technical exception thrown)MetaDataDocumentSizeException
- thrown when Query document Size is Too LargeInvalidParseOperationException
MetaDataClientServerException
public com.fasterxml.jackson.databind.JsonNode selectObjectGrouptbyId(com.fasterxml.jackson.databind.JsonNode selectQuery, String objectGroupId) throws MetaDataExecutionException, MetaDataDocumentSizeException, InvalidParseOperationException, MetadataInvalidSelectException, MetaDataClientServerException
MetaDataClient
selectObjectGrouptbyId
in interface MetaDataClient
selectQuery
- : select query Select
as JsonNode
objectGroupId
- : objectGroup id MetaDataExecutionException
- thrown when internal Server Error (fatal technical exception thrown)MetaDataDocumentSizeException
- thrown when Query document Size is Too LargeInvalidParseOperationException
- thrown when the Query is badly formatted or objectGroupId is emptyMetadataInvalidSelectException
- thrown when objectGroupId or selectQuery id is null or blankMetaDataClientServerException
public com.fasterxml.jackson.databind.JsonNode updateUnitById(com.fasterxml.jackson.databind.JsonNode updateQuery, String unitId) throws MetaDataExecutionException, MetaDataDocumentSizeException, InvalidParseOperationException, MetaDataClientServerException
MetaDataClient
updateUnitById
in interface MetaDataClient
updateQuery
- update query Select
as JsonNode
unitId
- unit id MetaDataExecutionException
- thrown when internal Server Error (fatal technical exception thrown)MetaDataDocumentSizeException
- thrown when Query document Size is Too LargeInvalidParseOperationException
MetaDataClientServerException
public com.fasterxml.jackson.databind.JsonNode insertObjectGroup(com.fasterxml.jackson.databind.JsonNode insertQuery) throws InvalidParseOperationException, MetaDataExecutionException, MetaDataNotFoundException, MetaDataDocumentSizeException, MetaDataClientServerException
insertObjectGroup
in interface MetaDataClient
insertQuery
- as StringInvalidParseOperationException
MetaDataExecutionException
MetaDataNotFoundException
MetaDataDocumentSizeException
MetaDataClientServerException
public com.fasterxml.jackson.databind.JsonNode insertObjectGroups(List<com.fasterxml.jackson.databind.JsonNode> insertQuery) throws InvalidParseOperationException, MetaDataExecutionException, MetaDataNotFoundException, MetaDataDocumentSizeException, MetaDataClientServerException
public List<UnitPerOriginatingAgency> selectAccessionRegisterOnUnitByOperationId(String operationId) throws MetaDataClientServerException
selectAccessionRegisterOnUnitByOperationId
in interface MetaDataClient
MetaDataClientServerException
public List<ObjectGroupPerOriginatingAgency> selectAccessionRegisterOnObjectByOperationId(String operationId) throws MetaDataClientServerException
selectAccessionRegisterOnObjectByOperationId
in interface MetaDataClient
MetaDataClientServerException
public com.fasterxml.jackson.databind.JsonNode selectObjectGroups(com.fasterxml.jackson.databind.JsonNode selectQuery) throws MetaDataExecutionException, MetaDataDocumentSizeException, InvalidParseOperationException, MetaDataClientServerException
MetaDataClient
selectObjectGroups
in interface MetaDataClient
selectQuery
- : select query SelectMultiQuery
as String MetaDataExecutionException
- thrown when internal Server Error (fatal technical exception thrown)MetaDataDocumentSizeException
- thrown when Query document Size is Too LargeInvalidParseOperationException
MetaDataClientServerException
public void updateObjectGroupById(com.fasterxml.jackson.databind.JsonNode objectGroup, String objectGroupId)
MetaDataClient
updateObjectGroupById
in interface MetaDataClient
public boolean refreshUnits()
refreshUnits
in interface MetaDataClient
public boolean refreshObjectGroups()
refreshObjectGroups
in interface MetaDataClient
public com.fasterxml.jackson.databind.JsonNode reindex(IndexParameters indexParam) throws InvalidParseOperationException, MetaDataClientServerException, MetaDataNotFoundException
MetaDataClient
reindex
in interface MetaDataClient
indexParam
- reindexation parametersInvalidParseOperationException
MetaDataClientServerException
MetaDataNotFoundException
- in case the index does not existpublic com.fasterxml.jackson.databind.JsonNode switchIndexes(SwitchIndexParameters switchIndexParam) throws InvalidParseOperationException, MetaDataClientServerException, MetaDataNotFoundException
MetaDataClient
switchIndexes
in interface MetaDataClient
switchIndexParam
- switch index parametersInvalidParseOperationException
MetaDataClientServerException
MetaDataNotFoundException
- in case the index does not existpublic RequestResponse<com.fasterxml.jackson.databind.JsonNode> getUnitByIdRaw(String unitId) throws VitamClientException
MetaDataClient
getUnitByIdRaw
in interface MetaDataClient
unitId
- : unit id VitamClientException
public RequestResponse<com.fasterxml.jackson.databind.JsonNode> getObjectGroupByIdRaw(String objectGroupId) throws VitamClientException
MetaDataClient
getObjectGroupByIdRaw
in interface MetaDataClient
objectGroupId
- : objectGroup id VitamClientException
public RequestResponse<com.fasterxml.jackson.databind.JsonNode> getUnitsByIdsRaw(Collection<String> unitIds)
MetaDataClient
getUnitsByIdsRaw
in interface MetaDataClient
unitIds
- : unit ids public RequestResponse<com.fasterxml.jackson.databind.JsonNode> getObjectGroupsByIdsRaw(Collection<String> objectGroupIds)
MetaDataClient
getObjectGroupsByIdsRaw
in interface MetaDataClient
objectGroupIds
- : object group ids public GraphComputeResponse computeGraph(com.fasterxml.jackson.databind.JsonNode queryDsl) throws VitamClientException
MetaDataClient
computeGraph
in interface MetaDataClient
VitamClientException
public GraphComputeResponse computeGraph(GraphComputeResponse.GraphComputeAction action, Set<String> ids) throws VitamClientException
MetaDataClient
computeGraph
in interface MetaDataClient
VitamClientException
public RequestResponse<com.fasterxml.jackson.databind.JsonNode> updateUnitBulk(com.fasterxml.jackson.databind.JsonNode updateQuery) throws InvalidParseOperationException, MetaDataExecutionException, MetaDataNotFoundException, MetaDataDocumentSizeException, MetaDataClientServerException
MetaDataClient
updateUnitBulk
in interface MetaDataClient
InvalidParseOperationException
MetaDataExecutionException
MetaDataNotFoundException
MetaDataDocumentSizeException
MetaDataClientServerException
public RequestResponse<com.fasterxml.jackson.databind.JsonNode> updateUnitsRulesBulk(List<String> unitsIds, RuleActions actions, Map<String,DurationData> rulesToDurationData) throws InvalidParseOperationException, MetaDataExecutionException, MetaDataNotFoundException, MetaDataDocumentSizeException, MetaDataClientServerException
MetaDataClient
updateUnitsRulesBulk
in interface MetaDataClient
unitsIds
- the bulk unit ids to updateInvalidParseOperationException
MetaDataExecutionException
MetaDataNotFoundException
MetaDataDocumentSizeException
MetaDataClientServerException
public void exportReclassificationChildNodes(Set<String> ids, String unitsToUpdateJsonLineFileName, String objectGroupsToUpdateJsonLineFileName)
MetaDataClient
exportReclassificationChildNodes
in interface MetaDataClient
ids
- the unit ids for which all descendant nodes (units and object groups) are to be updated.public com.fasterxml.jackson.databind.JsonNode selectUnitsWithInheritedRules(com.fasterxml.jackson.databind.JsonNode selectQuery)
MetaDataClient
selectUnitsWithInheritedRules
in interface MetaDataClient
selectQuery
- : select querypublic com.fasterxml.jackson.databind.JsonNode createAccessionRegisterSymbolic()
MetaDataClient
createAccessionRegisterSymbolic
in interface MetaDataClient
public void deleteUnitsBulk(Collection<String> listIds)
MetaDataClient
deleteUnitsBulk
in interface MetaDataClient
listIds
- list of id to deletepublic void deleteObjectGroupBulk(Collection<String> listIds)
MetaDataClient
deleteObjectGroupBulk
in interface MetaDataClient
listIds
- list of id to deletepublic javax.ws.rs.core.Response startComputeInheritedRules(com.fasterxml.jackson.databind.JsonNode dslQuery) throws MetaDataClientServerException
startComputeInheritedRules
in interface MetaDataClient
MetaDataClientServerException
Copyright © 2019 Vitam. All rights reserved.