Modifier and Type | Field and Description |
---|---|
static String |
COUNT |
static String |
ORIGINATING_AGENCY |
static String |
QUALIFIER_VERSION_OPI |
static String |
SP |
static String |
TOTAL_GOT |
static String |
TOTAL_OBJECT |
static String |
TOTAL_SIZE |
Constructor and Description |
---|
MetaDataImpl(MongoDbAccessMetadataImpl mongoDbAccess) |
Modifier and Type | Method and Description |
---|---|
List<org.bson.Document> |
createAccessionRegisterSymbolic(Integer tenant)
Creates the AccessionRegisterSymbolics from ElasticSearch aggregations and nested aggregation request.
|
void |
deleteObjectGroups(List<String> idList)
delete objectsGroups
|
void |
deleteUnits(List<String> idList)
delete units
|
MongoDbAccessMetadataImpl |
getMongoDbAccess() |
void |
insertObjectGroup(com.fasterxml.jackson.databind.JsonNode objectGroupRequest)
Insert an objectGroup
|
void |
insertObjectGroups(List<com.fasterxml.jackson.databind.JsonNode> objectGroupRequest) |
void |
insertUnit(com.fasterxml.jackson.databind.JsonNode insertRequest)
insert Unit
|
void |
insertUnits(List<com.fasterxml.jackson.databind.JsonNode> insertRequests) |
static MetaData |
newMetadata(MongoDbAccessMetadataImpl mongoDbAccessMetadata)
Get a new MetaDataImpl instance
|
void |
refreshObjectGroup()
Flush ObjectGroup Index
|
void |
refreshUnit()
Flush Unit Index
|
IndexationResult |
reindex(IndexParameters indexParam)
Reindex one or more collections
|
RequestResponse<com.fasterxml.jackson.databind.JsonNode> |
selectObjectGroupById(com.fasterxml.jackson.databind.JsonNode selectQuery,
String objectGroupId)
Search ObjectGroups by its Id and a Select Query
for this method, the roots will be filled for example request :{ |
RequestResponse<com.fasterxml.jackson.databind.JsonNode> |
selectObjectGroupsByQuery(com.fasterxml.jackson.databind.JsonNode selectQuery)
Search ObjectGroups by Select
Select Query |
List<ObjectGroupPerOriginatingAgency> |
selectOwnAccessionRegisterOnObjectGroupByOperationId(String operationId)
Select an Accession Register linked to an Operation
|
List<FacetBucket> |
selectOwnAccessionRegisterOnUnitByOperationId(String operationId)
find the number of archive unit per originating agency for a operationId
|
RequestResponse<com.fasterxml.jackson.databind.JsonNode> |
selectUnitsById(com.fasterxml.jackson.databind.JsonNode selectQuery,
String unitId)
|
RequestResponse<com.fasterxml.jackson.databind.JsonNode> |
selectUnitsByQuery(com.fasterxml.jackson.databind.JsonNode selectQuery)
Search UNITs by Select
Select Query |
void |
switchIndex(String alias,
String newIndexName)
Switch indexes for one or more collections
|
void |
updateObjectGroupId(com.fasterxml.jackson.databind.JsonNode updateQuery,
String objectId)
Update an object group
|
RequestResponse<com.fasterxml.jackson.databind.JsonNode> |
updateUnitbyId(com.fasterxml.jackson.databind.JsonNode updateQuery,
String unitId)
Update UNITs by Id
UpdateMultiQuery Query for this method, the roots will be filled for example request :{ |
RequestResponse<com.fasterxml.jackson.databind.JsonNode> |
updateUnits(com.fasterxml.jackson.databind.JsonNode updateQuery)
Update UNITs by Ids
UpdateMultiQuery Query for this method, the roots will be filled for example request :{ |
RequestResponse<com.fasterxml.jackson.databind.JsonNode> |
updateUnitsRules(com.fasterxml.jackson.databind.JsonNode updateQuery,
Map<String,DurationData> bindRuleToDuration)
Update UNITs Rules by Ids
UpdateMultiQuery Query for this method, the roots will be filled for example request : { "dslRequest": {"$roots":[{id:"id1"},{id:"id2"}],"$query":[]}, "ruleActions": {"add":[{"AppraisalRule":{"Rules":[{"Rule":"APP-00001","StartDate":"1982-09-01"}],"FinalAction":"Keep"}} ] } } |
public static final String ORIGINATING_AGENCY
public static final String QUALIFIER_VERSION_OPI
public static final String TOTAL_SIZE
public static final String TOTAL_OBJECT
public static final String TOTAL_GOT
public static final String COUNT
public static final String SP
public MetaDataImpl(MongoDbAccessMetadataImpl mongoDbAccess)
mongoDbAccess
- public MongoDbAccessMetadataImpl getMongoDbAccess()
public static MetaData newMetadata(MongoDbAccessMetadataImpl mongoDbAccessMetadata)
mongoDbAccessMetadata
- public void insertUnit(com.fasterxml.jackson.databind.JsonNode insertRequest) throws InvalidParseOperationException, MetaDataExecutionException, MetaDataAlreadyExistException, MetaDataNotFoundException
MetaData
insertUnit
in interface MetaData
insertRequest
- as String { $roots: roots, $query : query, $filter : multi, $data : data}InvalidParseOperationException
- Throw if json format is not correctMetaDataExecutionException
- Throw if error occurs when send Unit to databaseMetaDataAlreadyExistException
- Throw if Unit id already existsMetaDataNotFoundException
- Throw if parent of this unit is not foundpublic void insertUnits(List<com.fasterxml.jackson.databind.JsonNode> insertRequests) throws InvalidParseOperationException, MetaDataExecutionException, MetaDataAlreadyExistException, MetaDataNotFoundException
insertUnits
in interface MetaData
InvalidParseOperationException
MetaDataExecutionException
MetaDataAlreadyExistException
MetaDataNotFoundException
public void deleteUnits(List<String> idList) throws IllegalArgumentException, MetaDataExecutionException
MetaData
deleteUnits
in interface MetaData
idList
- idsListIllegalArgumentException
MetaDataExecutionException
public void deleteObjectGroups(List<String> idList) throws IllegalArgumentException, MetaDataExecutionException
MetaData
deleteObjectGroups
in interface MetaData
idList
- idsListIllegalArgumentException
MetaDataExecutionException
public void insertObjectGroup(com.fasterxml.jackson.databind.JsonNode objectGroupRequest) throws InvalidParseOperationException, MetaDataExecutionException, MetaDataAlreadyExistException
MetaData
insertObjectGroup
in interface MetaData
objectGroupRequest
- as JsonNode { $roots: roots, $query : query, $filter : multi, $data : data}InvalidParseOperationException
- Throw if json format is not correctMetaDataExecutionException
- Throw if error occurs when send Unit to databaseMetaDataAlreadyExistException
- Throw if Unit id already existspublic void insertObjectGroups(List<com.fasterxml.jackson.databind.JsonNode> objectGroupRequest) throws InvalidParseOperationException, MetaDataExecutionException, MetaDataAlreadyExistException
insertObjectGroups
in interface MetaData
InvalidParseOperationException
MetaDataExecutionException
MetaDataAlreadyExistException
public List<FacetBucket> selectOwnAccessionRegisterOnUnitByOperationId(String operationId) throws MetaDataExecutionException
MetaData
selectOwnAccessionRegisterOnUnitByOperationId
in interface MetaData
operationId
- operation idMetaDataExecutionException
public List<org.bson.Document> createAccessionRegisterSymbolic(Integer tenant)
MetaData
createAccessionRegisterSymbolic
in interface MetaData
tenant
- on related to the symbolic accession register to createpublic List<ObjectGroupPerOriginatingAgency> selectOwnAccessionRegisterOnObjectGroupByOperationId(String operationId)
MetaData
selectOwnAccessionRegisterOnObjectGroupByOperationId
in interface MetaData
operationId
- the operation identifierpublic RequestResponse<com.fasterxml.jackson.databind.JsonNode> selectUnitsByQuery(com.fasterxml.jackson.databind.JsonNode selectQuery) throws MetaDataExecutionException, InvalidParseOperationException, MetaDataDocumentSizeException, MetaDataNotFoundException, BadRequestException, VitamDBException
MetaData
Select
QueryselectUnitsByQuery
in interface MetaData
selectQuery
- the query of type JsonNodeMetaDataExecutionException
- Throw if error occurs when send Unit to databaseInvalidParseOperationException
- Thrown when json format is not correctMetaDataDocumentSizeException
- Throw if Unit size is too bigMetaDataNotFoundException
- Throw if unit by id not foundBadRequestException
- if a bad request is being usedVitamDBException
- in case a desynchro is recorded between Mongo and ESpublic RequestResponse<com.fasterxml.jackson.databind.JsonNode> selectObjectGroupsByQuery(com.fasterxml.jackson.databind.JsonNode selectQuery) throws MetaDataExecutionException, InvalidParseOperationException, MetaDataDocumentSizeException, MetaDataNotFoundException, BadRequestException, VitamDBException
MetaData
Select
QueryselectObjectGroupsByQuery
in interface MetaData
selectQuery
- the query of type JsonNodeMetaDataExecutionException
- Throw if error occurs when send Unit to databaseInvalidParseOperationException
- Thrown when json format is not correctMetaDataDocumentSizeException
- Throw if Unit size is too bigMetaDataNotFoundException
- Throw if unit by id not foundBadRequestException
- if a bad request is being usedVitamDBException
- in case a desynchro is recorded between Mongo and ESpublic RequestResponse<com.fasterxml.jackson.databind.JsonNode> selectUnitsById(com.fasterxml.jackson.databind.JsonNode selectQuery, String unitId) throws InvalidParseOperationException, MetaDataExecutionException, MetaDataDocumentSizeException, MetaDataNotFoundException, BadRequestException, VitamDBException
MetaData
Select
Query selectUnitsById
in interface MetaData
selectQuery
- the select query of type JsonNodeunitId
- the unit id for queryInvalidParseOperationException
- Thrown when json format is not correctMetaDataExecutionException
- Throw if error occurs when send Unit to databaseMetaDataDocumentSizeException
- Throw if Unit size is too bigMetaDataNotFoundException
- Throw if unit by id not foundBadRequestException
- if a bad request is being usedVitamDBException
- in case a desynchro is recorded between Mongo and ESpublic RequestResponse<com.fasterxml.jackson.databind.JsonNode> selectObjectGroupById(com.fasterxml.jackson.databind.JsonNode selectQuery, String objectGroupId) throws InvalidParseOperationException, MetaDataDocumentSizeException, MetaDataExecutionException, MetaDataNotFoundException, BadRequestException, VitamDBException
MetaData
selectObjectGroupById
in interface MetaData
selectQuery
- the query to filter results and make projectionsobjectGroupId
- the objectgroup idInvalidParseOperationException
- Thrown when json format is not correctMetaDataDocumentSizeException
- Throw if Unit size is too bigMetaDataExecutionException
- Throw if error occurs when send Unit to databaseMetaDataNotFoundException
- Thrown if no objectGroup is foundBadRequestException
- if a bad request is being usedVitamDBException
- in case a desynchro is recorded between Mongo and ESpublic void updateObjectGroupId(com.fasterxml.jackson.databind.JsonNode updateQuery, String objectId) throws InvalidParseOperationException, MetaDataExecutionException, VitamDBException
MetaData
updateObjectGroupId
in interface MetaData
updateQuery
- the request as a jsonobjectId
- the id of the object to be updatedInvalidParseOperationException
- Thrown when json format is not correctMetaDataExecutionException
- Thrown if error occurs when send Unit to databaseVitamDBException
- in case a desynchro is recorded between Mongo and ESpublic RequestResponse<com.fasterxml.jackson.databind.JsonNode> updateUnits(com.fasterxml.jackson.databind.JsonNode updateQuery) throws InvalidParseOperationException
MetaData
UpdateMultiQuery
Query updateUnits
in interface MetaData
updateQuery
- the update query as JsonNode containing unitIds in root partsInvalidParseOperationException
- Thrown when json format is not correctpublic RequestResponse<com.fasterxml.jackson.databind.JsonNode> updateUnitsRules(com.fasterxml.jackson.databind.JsonNode updateQuery, Map<String,DurationData> bindRuleToDuration) throws InvalidParseOperationException
MetaData
UpdateMultiQuery
Query updateUnitsRules
in interface MetaData
updateQuery
- the update query as JsonNode containing unitIds in root parts and updates in ruleActions partInvalidParseOperationException
- Thrown when json format is not correctpublic RequestResponse<com.fasterxml.jackson.databind.JsonNode> updateUnitbyId(com.fasterxml.jackson.databind.JsonNode updateQuery, String unitId) throws MetaDataNotFoundException, InvalidParseOperationException, MetaDataExecutionException, MetaDataDocumentSizeException, VitamDBException
MetaData
UpdateMultiQuery
Query updateUnitbyId
in interface MetaData
updateQuery
- the update query as JsonNodeunitId
- the id of Unit for queryMetaDataNotFoundException
- Throw if unit does not existInvalidParseOperationException
- Thrown when json format is not correctMetaDataExecutionException
- Throw if error occurs when send Unit to databaseMetaDataDocumentSizeException
- Throw if Unit size is too bigVitamDBException
- in case a desynchro is recorded between Mongo and ESpublic void refreshUnit() throws IllegalArgumentException, VitamThreadAccessException
MetaData
refreshUnit
in interface MetaData
IllegalArgumentException
- if tenant is wrongVitamThreadAccessException
- if tenant is wrongpublic void refreshObjectGroup() throws IllegalArgumentException, VitamThreadAccessException
MetaData
refreshObjectGroup
in interface MetaData
IllegalArgumentException
- if tenant is wrongVitamThreadAccessException
- if tenant is wrongpublic IndexationResult reindex(IndexParameters indexParam)
MetaData
public void switchIndex(String alias, String newIndexName) throws DatabaseException
MetaData
switchIndex
in interface MetaData
alias
- the alias namenewIndexName
- the new index to be pointed onDatabaseException
- in case error with database occursCopyright © 2018 Vitam. All rights reserved.