Class MongoDbInMemory

java.lang.Object
fr.gouv.vitam.common.database.server.MongoDbInMemory

public class MongoDbInMemory extends Object
Tools to update a Mongo document (as json) with a dsl query.
  • 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 request
      isMultiple - 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, RuleUpdateException
      Update 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

      public Set<String> getUpdatedFields()