Class MongoDbInMemory
- java.lang.Object
-
- fr.gouv.vitam.common.database.server.MongoDbInMemory
-
public class MongoDbInMemory extends java.lang.ObjectTools to update a Mongo document (as json) with a dsl query.
-
-
Constructor Summary
Constructors Constructor Description MongoDbInMemory(com.fasterxml.jackson.databind.JsonNode originalDocument, DynamicParserTokens parserTokens)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Set<java.lang.String>getUpdatedFields()com.fasterxml.jackson.databind.JsonNodegetUpdateJson(com.fasterxml.jackson.databind.JsonNode request, boolean isMultiple, VarNameAdapter varNameAdapter)Update the originalDocument with the given request.com.fasterxml.jackson.databind.JsonNodegetUpdateJson(AbstractParser<?> requestParser)Update the originalDocument with the given parser (containing the request)com.fasterxml.jackson.databind.JsonNodegetUpdateJsonForRule(RuleActions ruleActions, java.util.Map<java.lang.String,DurationData> bindRuleToDuration)Update the originalDocument with the given ruleActionsvoidresetUpdatedAU()Reset the updatedDocument with the original values
-
-
-
Constructor Detail
-
MongoDbInMemory
public MongoDbInMemory(com.fasterxml.jackson.databind.JsonNode originalDocument, DynamicParserTokens parserTokens)- Parameters:
originalDocument-parserTokens-
-
-
Method Detail
-
getUpdateJson
public com.fasterxml.jackson.databind.JsonNode getUpdateJson(com.fasterxml.jackson.databind.JsonNode request, boolean isMultiple, VarNameAdapter varNameAdapter) throws InvalidParseOperationExceptionUpdate 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, java.util.Map<java.lang.String,DurationData> bindRuleToDuration) throws InvalidParseOperationException, RuleUpdateException
Update the originalDocument with the given ruleActions- Parameters:
ruleActions- The given ruleActions containing the updates- Returns:
- the updated document
- Throws:
InvalidParseOperationExceptionRuleUpdateException
-
resetUpdatedAU
public void resetUpdatedAU()
Reset the updatedDocument with the original values
-
getUpdatedFields
public java.util.Set<java.lang.String> getUpdatedFields()
-
-