public class DbRequest extends Object
Constructor and Description |
---|
DbRequest() |
Modifier and Type | Method and Description |
---|---|
protected Set<String> |
aggregateUnitDepths(Collection<String> ids,
int relativeDepth)
Aggregate Unit Depths according to parent relative Depth
|
void |
deleteObjectGroups(List<String> documentsToDelete)
Delete object groups
|
void |
deleteUnits(List<String> documentsToDelete)
Delete units
|
protected Result<MetadataDocument<?>> |
exactDepthUnitQuery(Query realQuery,
Result<MetadataDocument<?>> previous,
int exactDepth,
Integer tenantId,
List<org.elasticsearch.search.sort.SortBuilder> sorts,
int offset,
int limit,
List<org.elasticsearch.search.aggregations.AggregationBuilder> facets,
String scrollId,
Integer scrollTimeout,
DynamicParserTokens parserTokens)
Execute one Unit Query using exact Depth
|
void |
execInsertObjectGroupRequests(List<InsertParserMultiple> requestParsers)
Inserts an object group
|
void |
execInsertUnitRequest(InsertParserMultiple requestParser)
Inserts a unit
|
void |
execInsertUnitRequests(BulkUnitInsertRequest request)
Inserts a unit
|
Result |
execRequest(RequestParserMultiple requestParser,
List<OntologyModel> ontologies)
The request should be already analyzed.
|
UpdatedDocument |
execRuleRequest(String documentId,
RuleActions ruleActions,
Map<String,DurationData> bindRuleToDuration,
OntologyValidator ontologyValidator,
UnitValidator unitValidator,
List<OntologyModel> ontologyModels)
Execute rule action on unit
|
UpdatedDocument |
execUpdateRequest(RequestParserMultiple requestParser,
String documentId,
MetadataCollections metadataCollection,
OntologyValidator ontologyValidator,
UnitValidator unitValidator,
List<OntologyModel> ontologyModels) |
protected Result<MetadataDocument<?>> |
executeQuery(RequestParserMultiple requestParser,
RequestToAbstract requestToMongodb,
int rank,
Result<MetadataDocument<?>> previous,
DynamicParserTokens parserTokens)
Execute one request
|
protected Result<MetadataDocument<?>> |
lastDeleteFilterProjection(DeleteToMongodb requestToMongodb,
Result<MetadataDocument<?>> last)
Finalize the queries with last True Delete
|
protected Result<MetadataDocument<?>> |
lastSelectFilterProjection(SelectToMongodb requestToMongodb,
Result<MetadataDocument<?>> last,
boolean checkConsistency)
Finalize the queries with last True Select
|
protected Result<MetadataDocument<?>> |
objectGroupQuery(Query realQuery,
Result<MetadataDocument<?>> previous,
Integer tenantId,
List<org.elasticsearch.search.sort.SortBuilder> sorts,
int offset,
int limit,
String scrollId,
Integer scrollTimeout,
List<org.elasticsearch.search.aggregations.AggregationBuilder> facets,
DynamicParserTokens parserTokens)
Execute one relative Depth ObjectGroup Query
|
protected Result<MetadataDocument<?>> |
relativeDepthUnitQuery(Query realQuery,
Result<MetadataDocument<?>> previous,
int relativeDepth,
Integer tenantId,
List<org.elasticsearch.search.sort.SortBuilder> sorts,
int offset,
int limit,
List<org.elasticsearch.search.aggregations.AggregationBuilder> facets,
String scrollId,
Integer scrollTimeout,
DynamicParserTokens parserTokens)
Execute one relative Depth Unit Query
|
protected Result<MetadataDocument<?>> |
sameDepthUnitQuery(Query realQuery,
Result<MetadataDocument<?>> previous,
Integer tenantId,
List<org.elasticsearch.search.sort.SortBuilder> sorts,
int offset,
int limit,
List<org.elasticsearch.search.aggregations.AggregationBuilder> facets,
String scrollId,
Integer scrollTimeout,
DynamicParserTokens parserTokens)
Execute one relative Depth Unit Query
|
public UpdatedDocument execRuleRequest(String documentId, RuleActions ruleActions, Map<String,DurationData> bindRuleToDuration, OntologyValidator ontologyValidator, UnitValidator unitValidator, List<OntologyModel> ontologyModels) throws InvalidParseOperationException, MetaDataExecutionException, InvalidCreateOperationException, MetaDataNotFoundException, MetadataValidationException
ontologyModels
- documentId
- the unitIdruleActions
- the list of ruleAction (by category)InvalidParseOperationException
MetaDataExecutionException
InvalidCreateOperationException
MetaDataNotFoundException
MetadataValidationException
public Result execRequest(RequestParserMultiple requestParser, List<OntologyModel> ontologies) throws MetaDataExecutionException, InvalidParseOperationException, BadRequestException, VitamDBException
requestParser
- the RequestParserMultiple to executeMetaDataExecutionException
- when select/update/delete on metadata collection exception occurredInvalidParseOperationException
- when json data exception occurredBadRequestException
VitamDBException
public UpdatedDocument execUpdateRequest(RequestParserMultiple requestParser, String documentId, MetadataCollections metadataCollection, OntologyValidator ontologyValidator, UnitValidator unitValidator, List<OntologyModel> ontologyModels) throws MetaDataExecutionException, InvalidParseOperationException, MetaDataNotFoundException, MetadataValidationException
protected Result<MetadataDocument<?>> executeQuery(RequestParserMultiple requestParser, RequestToAbstract requestToMongodb, int rank, Result<MetadataDocument<?>> previous, DynamicParserTokens parserTokens) throws MetaDataExecutionException, InvalidParseOperationException, BadRequestException
requestToMongodb
- rank
- current rank queryprevious
- previous Result from previous level (except in level == 0 where it is the subset of valid roots)MetaDataExecutionException
InvalidParseOperationException
BadRequestException
protected Result<MetadataDocument<?>> exactDepthUnitQuery(Query realQuery, Result<MetadataDocument<?>> previous, int exactDepth, Integer tenantId, List<org.elasticsearch.search.sort.SortBuilder> sorts, int offset, int limit, List<org.elasticsearch.search.aggregations.AggregationBuilder> facets, String scrollId, Integer scrollTimeout, DynamicParserTokens parserTokens) throws InvalidParseOperationException, MetaDataExecutionException, BadRequestException
realQuery
- previous
- exactDepth
- tenantId
- sorts
- offset
- limit
- facets
- InvalidParseOperationException
MetaDataExecutionException
BadRequestException
protected Result<MetadataDocument<?>> relativeDepthUnitQuery(Query realQuery, Result<MetadataDocument<?>> previous, int relativeDepth, Integer tenantId, List<org.elasticsearch.search.sort.SortBuilder> sorts, int offset, int limit, List<org.elasticsearch.search.aggregations.AggregationBuilder> facets, String scrollId, Integer scrollTimeout, DynamicParserTokens parserTokens) throws InvalidParseOperationException, MetaDataExecutionException, BadRequestException
realQuery
- previous
- relativeDepth
- tenantId
- sorts
- offset
- limit
- facets
- InvalidParseOperationException
MetaDataExecutionException
BadRequestException
protected Set<String> aggregateUnitDepths(Collection<String> ids, int relativeDepth)
ids
- relativeDepth
- protected Result<MetadataDocument<?>> sameDepthUnitQuery(Query realQuery, Result<MetadataDocument<?>> previous, Integer tenantId, List<org.elasticsearch.search.sort.SortBuilder> sorts, int offset, int limit, List<org.elasticsearch.search.aggregations.AggregationBuilder> facets, String scrollId, Integer scrollTimeout, DynamicParserTokens parserTokens) throws InvalidParseOperationException, MetaDataExecutionException, BadRequestException
realQuery
- previous
- tenantId
- sorts
- offset
- limit
- facets
- InvalidParseOperationException
MetaDataExecutionException
BadRequestException
protected Result<MetadataDocument<?>> objectGroupQuery(Query realQuery, Result<MetadataDocument<?>> previous, Integer tenantId, List<org.elasticsearch.search.sort.SortBuilder> sorts, int offset, int limit, String scrollId, Integer scrollTimeout, List<org.elasticsearch.search.aggregations.AggregationBuilder> facets, DynamicParserTokens parserTokens) throws InvalidParseOperationException, MetaDataExecutionException, BadRequestException
realQuery
- previous
- units, Note: only immediate Unit parents are allowedtenantId
- sorts
- offset
- limit
- InvalidParseOperationException
MetaDataExecutionException
BadRequestException
protected Result<MetadataDocument<?>> lastSelectFilterProjection(SelectToMongodb requestToMongodb, Result<MetadataDocument<?>> last, boolean checkConsistency) throws InvalidParseOperationException, VitamDBException
requestToMongodb
- last
- InvalidParseOperationException
VitamDBException
public void execInsertUnitRequest(InsertParserMultiple requestParser) throws MetaDataExecutionException, MetaDataNotFoundException
requestParser
- the InsertParserMultiple to executeMetaDataExecutionException
- when insert on metadata collection exception occurredMetaDataNotFoundException
- when metadata not found exceptionpublic void execInsertObjectGroupRequests(List<InsertParserMultiple> requestParsers) throws MetaDataExecutionException, InvalidParseOperationException
requestParsers
- the list of InsertParserMultiple to executeMetaDataExecutionException
- when insert on metadata collection exception occurredInvalidParseOperationException
- when json data exception occurredMetaDataAlreadyExistException
- when insert metadata exceptionprotected Result<MetadataDocument<?>> lastDeleteFilterProjection(DeleteToMongodb requestToMongodb, Result<MetadataDocument<?>> last) throws MetaDataExecutionException
requestToMongodb
- last
- InvalidParseOperationException
MetaDataExecutionException
public void execInsertUnitRequests(BulkUnitInsertRequest request) throws MetaDataExecutionException, MetaDataNotFoundException
request
- list of unit insert requestsMetaDataExecutionException
- when insert on metadata collection exception occurredMetaDataNotFoundException
- when metadata not found exceptionpublic void deleteUnits(List<String> documentsToDelete) throws MetaDataExecutionException
MetaDataExecutionException
public void deleteObjectGroups(List<String> documentsToDelete) throws MetaDataExecutionException
MetaDataExecutionException
Copyright © 2019 Vitam. All rights reserved.