Class AbstractParser<E extends AbstractRequest>

java.lang.Object
fr.gouv.vitam.common.database.parser.request.AbstractParser<E>
Type Parameters:
E - is one of RequestMultiple or RequestSingle
Direct Known Subclasses:
RequestParserMultiple, RequestParserSingle

public abstract class AbstractParser<E extends AbstractRequest> extends Object
Abstract class implementing Parser for a Request Common abstract for both Multiple and Single Request
  • Field Details

    • adapter

      protected VarNameAdapter adapter
    • sourceRequest

      protected String sourceRequest
    • request

      protected E extends AbstractRequest request
    • hasFullTextQuery

      protected boolean hasFullTextQuery
      Contains queries to be computed by a full text index
    • hasFullTextCurrentQuery

      protected boolean hasFullTextCurrentQuery
      Current analyzed query to be computed by a full text index
    • rootNode

      protected com.fasterxml.jackson.databind.JsonNode rootNode
  • Constructor Details

    • AbstractParser

      public AbstractParser()
  • Method Details

    • getSource

      public String getSource()
      Returns:
      the source
    • getRootNode

      public com.fasterxml.jackson.databind.JsonNode getRootNode()
      Returns:
      the rootNode
    • getRequest

      public E getRequest()
      Returns:
      the Request
    • getNewRequest

      protected abstract E getNewRequest()
      Returns:
      a new Request
    • parse

      public abstract void parse(com.fasterxml.jackson.databind.JsonNode jsonRequest) throws InvalidParseOperationException
      Parameters:
      jsonRequest - containing a parsed JSON as { $roots: root, $query : query, $filter : filter }
      Throws:
      InvalidParseOperationException - if jsonRequest could not parse to JSON
    • parseJson

      protected void parseJson(com.fasterxml.jackson.databind.JsonNode jsonRequest) throws InvalidParseOperationException
      Parameters:
      jsonRequest - containing a parsed JSON as { $roots: root, $query : query, $filter : filter }
      Throws:
      InvalidParseOperationException - if jsonRequest could not parse to JSON
    • hasFullTextQuery

      public final boolean hasFullTextQuery()
      Returns:
      the hasFullTextQuery
    • getAdapter

      public VarNameAdapter getAdapter()
      Returns:
      the adapter
    • analyzeOneCommand

      protected Query analyzeOneCommand(String refCommand, com.fasterxml.jackson.databind.JsonNode command) throws InvalidParseOperationException, InvalidCreateOperationException
      Throws:
      InvalidParseOperationException
      InvalidCreateOperationException
    • getLastDepth

      public abstract int getLastDepth()
      Returns:
      int the depth of the query
    • model

      public abstract BuilderToken.FILTERARGS model()
      Returns:
      FILTERARGS the filter argument
    • hintNoTimeout

      public abstract boolean hintNoTimeout()
      Returns:
      true if not time out
    • hintCache

      public abstract boolean hintCache()
      Returns:
      true if not cache hint
    • parseOrderByFilter

      protected void parseOrderByFilter(com.fasterxml.jackson.databind.JsonNode filterNode) throws InvalidParseOperationException
      Throws:
      InvalidParseOperationException