Class MongoDbInMemory


  • public class MongoDbInMemory
    extends java.lang.Object
    Tools 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.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, java.util.Map<java.lang.String,​DurationData> bindRuleToDuration)
      Update the originalDocument with the given ruleActions
      void resetUpdatedAU()
      Reset the updatedDocument with the original values
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 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
      • resetUpdatedAU

        public void resetUpdatedAU()
        Reset the updatedDocument with the original values
      • getUpdatedFields

        public java.util.Set<java.lang.String> getUpdatedFields()