public abstract class RequestParserMultiple extends AbstractParser<RequestMultiple>
Modifier and Type | Field and Description |
---|---|
protected static int |
FILTER_POS |
protected int |
lastDepth
Last computed Depth
|
protected static int |
QUERY_POS |
protected static int |
ROOT_POS
Component's position [ {root}, {query}, {filter} ] [ 0 , 1 , 2 ]
|
adapter, hasFullTextCurrentQuery, hasFullTextQuery, request, rootNode, sourceRequest
Constructor and Description |
---|
RequestParserMultiple()
Constructor for Internal API
|
RequestParserMultiple(VarNameAdapter adapter)
Constructor for Metadata
|
Modifier and Type | Method and Description |
---|---|
void |
addCondition(Query condition)
Allow to add one condition to the current parsed Request on top Query
Example:
|
protected void |
analyzeRootQuery(com.fasterxml.jackson.databind.JsonNode command)
{ expression, $exactdepth : exactdepth, $depth : /- depth }, $exactdepth and $depth being optional (mutual
exclusive)
|
protected void |
filterParse(com.fasterxml.jackson.databind.JsonNode rootNode)
Filter part
|
String |
getFinalScrollId()
get ScrollId
|
int |
getFinalScrollTimeout()
get ScrollTimeout
|
int |
getLastDepth() |
RequestMultiple |
getRequest() |
boolean |
hintCache() |
boolean |
hintNoTimeout() |
BuilderToken.FILTERARGS |
model() |
protected void |
parseJson(com.fasterxml.jackson.databind.JsonNode jsonRequest) |
protected void |
parseQueryOnly(String query) |
protected void |
queryParse(com.fasterxml.jackson.databind.JsonNode rootNode)
[ query, query ] or { query } if one level only
|
protected void |
rootParse(com.fasterxml.jackson.databind.JsonNode rootNode)
Will be used as extra arguments in the first query
|
String |
toString() |
analyzeArrayCommand, analyzeOneCommand, getNewRequest, getRequestId, getRootNode, getSource, hasFullTextQuery, isCommandAsFullText, parse
protected static final int ROOT_POS
protected static final int QUERY_POS
protected static final int FILTER_POS
protected int lastDepth
public RequestParserMultiple()
public RequestParserMultiple(VarNameAdapter adapter)
adapter
- VarNameAdapterprotected void parseJson(com.fasterxml.jackson.databind.JsonNode jsonRequest) throws InvalidParseOperationException
parseJson
in class AbstractParser<RequestMultiple>
jsonRequest
- containing a parsed JSON as [ {root}, {query}, {filter} ] or { $roots: root, $query : query,
$filter : filter }InvalidParseOperationException
- if jsonRequest could not parse to JSONprotected void parseQueryOnly(String query) throws InvalidParseOperationException
query
- containing only the JSON query part (no filter neither roots)InvalidParseOperationException
- if query could not parse to JSONprotected void rootParse(com.fasterxml.jackson.databind.JsonNode rootNode) throws InvalidParseOperationException
rootNode
- JsonNode the root of the requestInvalidParseOperationException
- if rootNode could not parse to JSONprotected void filterParse(com.fasterxml.jackson.databind.JsonNode rootNode) throws InvalidParseOperationException
rootNode
- JsonNode The filter of the requestInvalidParseOperationException
- if rootNode could not parse to JSONprotected void queryParse(com.fasterxml.jackson.databind.JsonNode rootNode) throws InvalidParseOperationException
rootNode
- JsonNode the query of the requestInvalidParseOperationException
- if rootNode could not parse to JSONprotected void analyzeRootQuery(com.fasterxml.jackson.databind.JsonNode command) throws InvalidParseOperationException, InvalidCreateOperationException
command
- JsonNodeInvalidParseOperationException
- if query could not parse to JSONInvalidCreateOperationException
- if could not create query in JSONpublic RequestMultiple getRequest()
getRequest
in class AbstractParser<RequestMultiple>
public void addCondition(Query condition) throws InvalidCreateOperationException, InvalidParseOperationException
XxxxxxxParserMultiple parser = new XxxxxxParserMultiple(...);
parser.parse(jsonQuery);
parser.addCondition(eq(FieldName, value));
JsonNode newJsonQuery = parser.getRootNode();
condition
- the condition to addInvalidCreateOperationException
- when invalid create query exception occurredInvalidParseOperationException
- when invalid parse data to create querypublic final int getLastDepth()
getLastDepth
in class AbstractParser<RequestMultiple>
public boolean hintCache()
hintCache
in class AbstractParser<RequestMultiple>
public boolean hintNoTimeout()
hintNoTimeout
in class AbstractParser<RequestMultiple>
public BuilderToken.FILTERARGS model()
model
in class AbstractParser<RequestMultiple>
public String getFinalScrollId()
public int getFinalScrollTimeout()
Copyright © 2018 Vitam. All rights reserved.