Class MongoDbInMemory
java.lang.Object
fr.gouv.vitam.common.database.server.MongoDbInMemory
Tools to update a Mongo document (as json) with a dsl query.
-
Constructor Summary
ConstructorDescriptionMongoDbInMemory
(com.fasterxml.jackson.databind.JsonNode originalDocument, DynamicParserTokens parserTokens) -
Method Summary
Modifier and TypeMethodDescriptioncom.fasterxml.jackson.databind.JsonNode
getUpdateJson
(com.fasterxml.jackson.databind.JsonNode request, boolean isMultiple, VarNameAdapter varNameAdapter) Update the originalDocument with the given request.com.fasterxml.jackson.databind.JsonNode
getUpdateJson
(AbstractParser<?> requestParser) Update the originalDocument with the given parser (containing the request)com.fasterxml.jackson.databind.JsonNode
getUpdateJsonForRule
(RuleActions ruleActions, Map<String, DurationData> bindRuleToDuration) Update the originalDocument with the given ruleActionsvoid
Reset the updatedDocument with the original values
-
Constructor Details
-
MongoDbInMemory
public MongoDbInMemory(com.fasterxml.jackson.databind.JsonNode originalDocument, DynamicParserTokens parserTokens) - Parameters:
originalDocument
-parserTokens
-
-
-
Method Details
-
getUpdateJson
public com.fasterxml.jackson.databind.JsonNode getUpdateJson(com.fasterxml.jackson.databind.JsonNode request, boolean isMultiple, VarNameAdapter varNameAdapter) throws InvalidParseOperationException Update the originalDocument with the given request. If the Document is a MetadataDocument (Unit/ObjectGroup) it should use a MultipleQuery Parser- Parameters:
request
- The given update requestisMultiple
- true if the UpdateParserMultiple must be used (Unit/ObjectGroup)varNameAdapter
- VarNameAdapter to use- Returns:
- the updated document
- Throws:
InvalidParseOperationException
-
getUpdateJson
public com.fasterxml.jackson.databind.JsonNode getUpdateJson(AbstractParser<?> requestParser) throws InvalidParseOperationException Update the originalDocument with the given parser (containing the request)- Parameters:
requestParser
- The given parser containing the update request- Returns:
- the updated document
- Throws:
InvalidParseOperationException
-
getUpdateJsonForRule
public com.fasterxml.jackson.databind.JsonNode getUpdateJsonForRule(RuleActions ruleActions, Map<String, DurationData> bindRuleToDuration) throws InvalidParseOperationException, RuleUpdateExceptionUpdate the originalDocument with the given ruleActions- Parameters:
ruleActions
- The given ruleActions containing the updates- Returns:
- the updated document
- Throws:
InvalidParseOperationException
RuleUpdateException
-
resetUpdatedAU
public void resetUpdatedAU()Reset the updatedDocument with the original values -
getUpdatedFields
-