Package fr.gouv.vitam.metadata.core
Class MetaDataImpl
- java.lang.Object
-
- fr.gouv.vitam.metadata.core.MetaDataImpl
-
public class MetaDataImpl extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description static int
MAX_PRECISION_THRESHOLD
static java.lang.String
SNAPSHOT_COLLECTION
-
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 void
checkStreamUnits(int tenantId, short streamExecutionLimit)
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(java.util.List<com.fasterxml.jackson.databind.JsonNode> unitRequest)
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)
MetadataResult
selectObjectGroupById(com.fasterxml.jackson.databind.JsonNode selectQuery, java.lang.String objectGroupId)
MetadataResult
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)
MetadataResult
selectUnitsById(com.fasterxml.jackson.databind.JsonNode selectQuery, java.lang.String unitId)
MetadataResult
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)
void
updateParameterStreamUnits(int tenantId)
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)
-
-
-
Field Detail
-
MAX_PRECISION_THRESHOLD
public static final int MAX_PRECISION_THRESHOLD
- See Also:
- Constant Field Values
-
SNAPSHOT_COLLECTION
public static final java.lang.String SNAPSHOT_COLLECTION
- See Also:
- Constant Field Values
-
-
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(java.util.List<com.fasterxml.jackson.databind.JsonNode> unitRequest) 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 MetadataResult selectUnitsByQuery(com.fasterxml.jackson.databind.JsonNode selectQuery) throws MetaDataExecutionException, InvalidParseOperationException, MetaDataDocumentSizeException, MetaDataNotFoundException, BadRequestException, VitamDBException
-
selectObjectGroupsByQuery
public MetadataResult selectObjectGroupsByQuery(com.fasterxml.jackson.databind.JsonNode selectQuery) throws MetaDataExecutionException, InvalidParseOperationException, MetaDataDocumentSizeException, MetaDataNotFoundException, BadRequestException, VitamDBException
-
selectUnitsById
public MetadataResult selectUnitsById(com.fasterxml.jackson.databind.JsonNode selectQuery, java.lang.String unitId) throws InvalidParseOperationException, MetaDataExecutionException, MetaDataDocumentSizeException, MetaDataNotFoundException, BadRequestException, VitamDBException
-
selectObjectGroupById
public MetadataResult 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
-
checkStreamUnits
public void checkStreamUnits(int tenantId, short streamExecutionLimit) throws MetaDataException
- Throws:
MetaDataException
-
updateParameterStreamUnits
public void updateParameterStreamUnits(int tenantId)
-
-