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 java.lang.Object
Abstract class implementing Parser for a Request Common abstract for both Multiple and Single Request
-
-
Field Summary
Fields Modifier and Type Field Description protected VarNameAdapter
adapter
protected boolean
hasFullTextCurrentQuery
Current analyzed query to be computed by a full text indexprotected boolean
hasFullTextQuery
Contains queries to be computed by a full text indexprotected E
request
protected com.fasterxml.jackson.databind.JsonNode
rootNode
protected java.lang.String
sourceRequest
-
Constructor Summary
Constructors Constructor Description AbstractParser()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected Query
analyzeOneCommand(java.lang.String refCommand, com.fasterxml.jackson.databind.JsonNode command)
VarNameAdapter
getAdapter()
abstract int
getLastDepth()
protected abstract E
getNewRequest()
E
getRequest()
com.fasterxml.jackson.databind.JsonNode
getRootNode()
java.lang.String
getSource()
boolean
hasFullTextQuery()
abstract boolean
hintCache()
abstract boolean
hintNoTimeout()
abstract BuilderToken.FILTERARGS
model()
abstract void
parse(com.fasterxml.jackson.databind.JsonNode jsonRequest)
protected void
parseJson(com.fasterxml.jackson.databind.JsonNode jsonRequest)
protected void
parseOrderByFilter(com.fasterxml.jackson.databind.JsonNode filterNode)
-
-
-
Field Detail
-
adapter
protected VarNameAdapter adapter
-
sourceRequest
protected java.lang.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
-
-
Method Detail
-
getSource
public java.lang.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(java.lang.String refCommand, com.fasterxml.jackson.databind.JsonNode command) 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
-
-