Package fr.gouv.vitam.metadata.core
Class MetaDataImpl
- java.lang.Object
-
- fr.gouv.vitam.metadata.core.MetaDataImpl
-
public class MetaDataImpl extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description MetaDataImpl(MongoDbAccessMetadataImpl mongoDbAccess, int ontologyCacheMaxEntries, int ontologyCacheTimeoutInSeconds, int archiveUnitProfileCacheMaxEntries, int archiveUnitProfileCacheTimeoutInSeconds, int schemaValidatorCacheMaxEntries, int schemaValidatorCacheTimeoutInSeconds, ElasticsearchMetadataIndexManager indexManager)
MetaDataImpl(MongoDbAccessMetadataImpl mongoDbAccess, AdminManagementClientFactory adminManagementClientFactory, IndexationHelper indexationHelper, DbRequest dbRequest, int ontologyCacheMaxEntries, int ontologyCacheTimeoutInSeconds, int archiveUnitProfileCacheMaxEntries, int archiveUnitProfileCacheTimeoutInSeconds, int schemaValidatorCacheMaxEntries, int schemaValidatorCacheTimeoutInSeconds, ElasticsearchMetadataIndexManager indexManager)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<org.bson.Document>
createAccessionRegisterSymbolic(java.lang.Integer tenant)
void
deleteObjectGroups(java.util.List<java.lang.String> idList)
void
deleteUnits(java.util.List<java.lang.String> idList)
MongoDbAccessMetadataImpl
getMongoDbAccess()
void
insertObjectGroup(com.fasterxml.jackson.databind.JsonNode objectGroupRequest)
void
insertObjectGroups(java.util.List<com.fasterxml.jackson.databind.JsonNode> objectGroupRequest)
void
insertUnits(BulkUnitInsertRequest request)
static MetaDataImpl
newMetadata(MongoDbAccessMetadataImpl mongoDbAccessMetadata, int ontologyCacheMaxEntries, int ontologyCacheTimeoutInSeconds, int archiveUnitProfileCacheMaxEntries, int archiveUnitProfileCacheTimeoutInSeconds, int schemaValidatorCacheMaxEntries, int schemaValidatorCacheTimeoutInSeconds, ElasticsearchMetadataIndexManager indexManager)
Get a new MetaDataImpl instancevoid
refreshObjectGroup()
void
refreshUnit()
ReindexationResult
reindex(IndexParameters indexParameters)
RequestResponse<com.fasterxml.jackson.databind.JsonNode>
selectObjectGroupById(com.fasterxml.jackson.databind.JsonNode selectQuery, java.lang.String objectGroupId)
RequestResponse<com.fasterxml.jackson.databind.JsonNode>
selectObjectGroupsByQuery(com.fasterxml.jackson.databind.JsonNode selectQuery)
java.util.List<ObjectGroupPerOriginatingAgency>
selectOwnAccessionRegisterOnObjectGroupByOperationId(java.lang.Integer tenant, java.lang.String operationId)
java.util.List<FacetBucket>
selectOwnAccessionRegisterOnUnitByOperationId(java.lang.String operationId)
RequestResponse<com.fasterxml.jackson.databind.JsonNode>
selectUnitsById(com.fasterxml.jackson.databind.JsonNode selectQuery, java.lang.String unitId)
RequestResponse<com.fasterxml.jackson.databind.JsonNode>
selectUnitsByQuery(com.fasterxml.jackson.databind.JsonNode selectQuery)
SwitchIndexResult
switchIndex(java.lang.String alias, java.lang.String newIndexName)
void
updateObjectGroupId(com.fasterxml.jackson.databind.JsonNode updateQuery, java.lang.String objectId, boolean forceUpdate)
UpdateUnit
updateUnitById(com.fasterxml.jackson.databind.JsonNode updateQuery, java.lang.String unitId, boolean forceUpdate)
RequestResponse<UpdateUnit>
updateUnits(com.fasterxml.jackson.databind.JsonNode updateQuery, boolean forceUpdate)
RequestResponse<UpdateUnit>
updateUnitsRules(java.util.List<java.lang.String> unitIds, RuleActions ruleActions, java.util.Map<java.lang.String,DurationData> bindRuleToDuration)
-
-
-
Constructor Detail
-
MetaDataImpl
public MetaDataImpl(MongoDbAccessMetadataImpl mongoDbAccess, int ontologyCacheMaxEntries, int ontologyCacheTimeoutInSeconds, int archiveUnitProfileCacheMaxEntries, int archiveUnitProfileCacheTimeoutInSeconds, int schemaValidatorCacheMaxEntries, int schemaValidatorCacheTimeoutInSeconds, ElasticsearchMetadataIndexManager indexManager)
-
MetaDataImpl
public MetaDataImpl(MongoDbAccessMetadataImpl mongoDbAccess, AdminManagementClientFactory adminManagementClientFactory, IndexationHelper indexationHelper, DbRequest dbRequest, int ontologyCacheMaxEntries, int ontologyCacheTimeoutInSeconds, int archiveUnitProfileCacheMaxEntries, int archiveUnitProfileCacheTimeoutInSeconds, int schemaValidatorCacheMaxEntries, int schemaValidatorCacheTimeoutInSeconds, ElasticsearchMetadataIndexManager indexManager)
-
-
Method Detail
-
newMetadata
public static MetaDataImpl newMetadata(MongoDbAccessMetadataImpl mongoDbAccessMetadata, int ontologyCacheMaxEntries, int ontologyCacheTimeoutInSeconds, int archiveUnitProfileCacheMaxEntries, int archiveUnitProfileCacheTimeoutInSeconds, int schemaValidatorCacheMaxEntries, int schemaValidatorCacheTimeoutInSeconds, ElasticsearchMetadataIndexManager indexManager)
Get a new MetaDataImpl instance- Parameters:
mongoDbAccessMetadata
-indexManager
-- Returns:
- a new instance of MetaDataImpl
-
getMongoDbAccess
public MongoDbAccessMetadataImpl getMongoDbAccess()
- Returns:
- the MongoDbAccessMetadataImpl
-
insertUnits
public void insertUnits(BulkUnitInsertRequest request) throws InvalidParseOperationException, MetaDataExecutionException, MetaDataNotFoundException
-
deleteUnits
public void deleteUnits(java.util.List<java.lang.String> idList) throws java.lang.IllegalArgumentException, MetaDataExecutionException
- Throws:
java.lang.IllegalArgumentException
MetaDataExecutionException
-
deleteObjectGroups
public void deleteObjectGroups(java.util.List<java.lang.String> idList) throws java.lang.IllegalArgumentException, MetaDataExecutionException
- Throws:
java.lang.IllegalArgumentException
MetaDataExecutionException
-
insertObjectGroup
public void insertObjectGroup(com.fasterxml.jackson.databind.JsonNode objectGroupRequest) throws InvalidParseOperationException, MetaDataExecutionException
-
insertObjectGroups
public void insertObjectGroups(java.util.List<com.fasterxml.jackson.databind.JsonNode> objectGroupRequest) throws InvalidParseOperationException, MetaDataExecutionException
-
selectOwnAccessionRegisterOnUnitByOperationId
public java.util.List<FacetBucket> selectOwnAccessionRegisterOnUnitByOperationId(java.lang.String operationId) throws MetaDataExecutionException
- Parameters:
operationId
- operation id- Returns:
- List of FacetBucket
- Throws:
MetaDataExecutionException
-
createAccessionRegisterSymbolic
public java.util.List<org.bson.Document> createAccessionRegisterSymbolic(java.lang.Integer tenant) throws MetaDataExecutionException
- Throws:
MetaDataExecutionException
-
selectOwnAccessionRegisterOnObjectGroupByOperationId
public java.util.List<ObjectGroupPerOriginatingAgency> selectOwnAccessionRegisterOnObjectGroupByOperationId(java.lang.Integer tenant, java.lang.String operationId) throws MetaDataExecutionException
- Throws:
MetaDataExecutionException
-
selectUnitsByQuery
public RequestResponse<com.fasterxml.jackson.databind.JsonNode> selectUnitsByQuery(com.fasterxml.jackson.databind.JsonNode selectQuery) throws MetaDataExecutionException, InvalidParseOperationException, MetaDataDocumentSizeException, MetaDataNotFoundException, BadRequestException, VitamDBException
-
selectObjectGroupsByQuery
public RequestResponse<com.fasterxml.jackson.databind.JsonNode> selectObjectGroupsByQuery(com.fasterxml.jackson.databind.JsonNode selectQuery) throws MetaDataExecutionException, InvalidParseOperationException, MetaDataDocumentSizeException, MetaDataNotFoundException, BadRequestException, VitamDBException
-
selectUnitsById
public RequestResponse<com.fasterxml.jackson.databind.JsonNode> selectUnitsById(com.fasterxml.jackson.databind.JsonNode selectQuery, java.lang.String unitId) throws InvalidParseOperationException, MetaDataExecutionException, MetaDataDocumentSizeException, MetaDataNotFoundException, BadRequestException, VitamDBException
-
selectObjectGroupById
public RequestResponse<com.fasterxml.jackson.databind.JsonNode> selectObjectGroupById(com.fasterxml.jackson.databind.JsonNode selectQuery, java.lang.String objectGroupId) throws InvalidParseOperationException, MetaDataDocumentSizeException, MetaDataExecutionException, MetaDataNotFoundException, BadRequestException, VitamDBException
-
updateObjectGroupId
public void updateObjectGroupId(com.fasterxml.jackson.databind.JsonNode updateQuery, java.lang.String objectId, boolean forceUpdate) throws InvalidParseOperationException, MetaDataExecutionException, MetaDataNotFoundException, MetadataValidationException
-
updateUnits
public RequestResponse<UpdateUnit> updateUnits(com.fasterxml.jackson.databind.JsonNode updateQuery, boolean forceUpdate) throws InvalidParseOperationException
- Throws:
InvalidParseOperationException
-
updateUnitsRules
public RequestResponse<UpdateUnit> updateUnitsRules(java.util.List<java.lang.String> unitIds, RuleActions ruleActions, java.util.Map<java.lang.String,DurationData> bindRuleToDuration)
-
updateUnitById
public UpdateUnit updateUnitById(com.fasterxml.jackson.databind.JsonNode updateQuery, java.lang.String unitId, boolean forceUpdate) throws MetaDataNotFoundException, InvalidParseOperationException, MetaDataExecutionException, MetadataValidationException
-
refreshUnit
public void refreshUnit() throws java.lang.IllegalArgumentException, VitamThreadAccessException, MetaDataExecutionException
- Throws:
java.lang.IllegalArgumentException
VitamThreadAccessException
MetaDataExecutionException
-
refreshObjectGroup
public void refreshObjectGroup() throws java.lang.IllegalArgumentException, VitamThreadAccessException, MetaDataExecutionException
- Throws:
java.lang.IllegalArgumentException
VitamThreadAccessException
MetaDataExecutionException
-
reindex
public ReindexationResult reindex(IndexParameters indexParameters)
-
switchIndex
public SwitchIndexResult switchIndex(java.lang.String alias, java.lang.String newIndexName) throws DatabaseException
- Throws:
DatabaseException
-
-