Class AbstractRequest
- java.lang.Object
-
- fr.gouv.vitam.common.database.builder.request.AbstractRequest
-
- Direct Known Subclasses:
RequestMultiple
,RequestSingle
public abstract class AbstractRequest extends java.lang.Object
Common Abstract Request
-
-
Field Summary
Fields Modifier and Type Field Description protected com.fasterxml.jackson.databind.node.ObjectNode
filter
protected com.fasterxml.jackson.databind.node.ObjectNode
projection
-
Constructor Summary
Constructors Constructor Description AbstractRequest()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description AbstractRequest
addHintFilter(com.fasterxml.jackson.databind.JsonNode filterContent)
AbstractRequest
addHintFilter(java.lang.String... hints)
abstract java.util.List<Action>
getActions()
abstract boolean
getAllProjection()
abstract com.fasterxml.jackson.databind.JsonNode
getData()
com.fasterxml.jackson.databind.node.ObjectNode
getFilter()
protected abstract com.fasterxml.jackson.databind.node.ObjectNode
getFinal()
Get the json final of requestabstract int
getNbQueries()
abstract com.fasterxml.jackson.databind.node.ObjectNode
getProjection()
abstract java.util.List<Query>
getQueries()
abstract java.util.Set<java.lang.String>
getRoots()
AbstractRequest
parseFilter(java.lang.String filter)
AbstractRequest
reset()
AbstractRequest
resetFilter()
AbstractRequest
resetHintFilter()
protected AbstractRequest
selectAddOrderByAscFilter(java.lang.String... variableNames)
protected AbstractRequest
selectAddOrderByDescFilter(java.lang.String... variableNames)
protected AbstractRequest
selectAddOrderByFilter(com.fasterxml.jackson.databind.JsonNode filterContent)
protected AbstractRequest
selectAddProjection(com.fasterxml.jackson.databind.JsonNode projectionContent)
protected AbstractRequest
selectAddUnusedProjection(java.lang.String... variableNames)
protected AbstractRequest
selectAddUsedProjection(java.lang.String... variableNames)
protected boolean
selectGetAllProjection()
protected com.fasterxml.jackson.databind.node.ObjectNode
selectGetFinalSelect()
protected com.fasterxml.jackson.databind.node.ObjectNode
selectGetProjection()
protected AbstractRequest
selectParseLimitFilter(java.lang.String filter)
protected AbstractRequest
selectParseOrderByFilter(java.lang.String filter)
protected AbstractRequest
selectParseProjection(java.lang.String projection)
protected AbstractRequest
selectReset()
protected AbstractRequest
selectResetLimitFilter()
protected AbstractRequest
selectResetOrderByFilter()
protected AbstractRequest
selectResetUsedProjection()
protected AbstractRequest
selectSetFilter(com.fasterxml.jackson.databind.JsonNode filterContent)
protected AbstractRequest
selectSetLimitFilter(long offset, long limit)
protected AbstractRequest
selectSetLimitFilter(com.fasterxml.jackson.databind.JsonNode filterContent)
protected AbstractRequest
selectSetProjection(com.fasterxml.jackson.databind.JsonNode projectionContent)
protected AbstractRequest
selectSetScrollFilter(java.lang.String scrollId, int scrollTimeout, int limit)
AbstractRequest
setFilter(com.fasterxml.jackson.databind.JsonNode filterContent)
abstract AbstractRequest
setQuery(Query query)
Set the query of request: in case of multi-query request: re-initialize list of queryjava.lang.String
toString()
-
-
-
Method Detail
-
resetHintFilter
public final AbstractRequest resetHintFilter()
- Returns:
- this Request
-
resetFilter
public final AbstractRequest resetFilter()
- Returns:
- this Request
-
reset
public AbstractRequest reset()
- Returns:
- this Request
-
addHintFilter
public final AbstractRequest addHintFilter(java.lang.String... hints) throws InvalidParseOperationException
- Parameters:
hints
- list of hint- Returns:
- this Request
- Throws:
InvalidParseOperationException
- when query is invalid
-
addHintFilter
public final AbstractRequest addHintFilter(com.fasterxml.jackson.databind.JsonNode filterContent)
- Parameters:
filterContent
- json filter- Returns:
- this Request
-
setFilter
public AbstractRequest setFilter(com.fasterxml.jackson.databind.JsonNode filterContent) throws InvalidParseOperationException
- Parameters:
filterContent
- json filter- Returns:
- this Request
- Throws:
InvalidParseOperationException
- when query is invalid
-
parseFilter
public final AbstractRequest parseFilter(java.lang.String filter) throws InvalidParseOperationException
- Parameters:
filter
- String filter- Returns:
- this Request
- Throws:
InvalidParseOperationException
- when query is invalid
-
getFilter
public final com.fasterxml.jackson.databind.node.ObjectNode getFilter()
- Returns:
- the filter
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
setQuery
public abstract AbstractRequest setQuery(Query query) throws InvalidCreateOperationException
Set the query of request: in case of multi-query request: re-initialize list of query- Parameters:
query
- of request- Returns:
- this request
- Throws:
InvalidCreateOperationException
- when query is invalid
-
getNbQueries
public abstract int getNbQueries()
- Returns:
- the number of queries
-
getQueries
public abstract java.util.List<Query> getQueries()
- Returns:
- the queries list
-
getRoots
public abstract java.util.Set<java.lang.String> getRoots()
- Returns:
- the queries list
-
getData
public abstract com.fasterxml.jackson.databind.JsonNode getData()
- Returns:
- the data
-
getActions
public abstract java.util.List<Action> getActions()
- Returns:
- list of actions
-
getAllProjection
public abstract boolean getAllProjection()
- Returns:
- True if the projection is not restricted
-
getProjection
public abstract com.fasterxml.jackson.databind.node.ObjectNode getProjection()
- Returns:
- the projection
-
selectResetLimitFilter
protected final AbstractRequest selectResetLimitFilter()
- Returns:
- this Query
-
selectResetOrderByFilter
protected final AbstractRequest selectResetOrderByFilter()
- Returns:
- this Query
-
selectResetUsedProjection
protected final AbstractRequest selectResetUsedProjection()
- Returns:
- this Query
-
selectReset
protected final AbstractRequest selectReset()
-
selectSetScrollFilter
protected final AbstractRequest selectSetScrollFilter(java.lang.String scrollId, int scrollTimeout, int limit)
- Parameters:
scrollId
- ignored if empty or nullscrollTimeout
- ignored if 0limit
- ignored if 0- Returns:
- this Query
-
selectSetLimitFilter
protected final AbstractRequest selectSetLimitFilter(long offset, long limit)
- Parameters:
offset
- ignored if 0limit
- ignored if 0- Returns:
- this Query
-
selectSetLimitFilter
protected final AbstractRequest selectSetLimitFilter(com.fasterxml.jackson.databind.JsonNode filterContent)
- Parameters:
filterContent
- json filter- Returns:
- this Query
-
selectParseLimitFilter
protected final AbstractRequest selectParseLimitFilter(java.lang.String filter) throws InvalidParseOperationException
- Parameters:
filter
- string filter- Returns:
- this Query
- Throws:
InvalidParseOperationException
- when query is invalid
-
selectAddOrderByAscFilter
protected final AbstractRequest selectAddOrderByAscFilter(java.lang.String... variableNames) throws InvalidParseOperationException
- Parameters:
variableNames
- list of key name- Returns:
- this Query
- Throws:
InvalidParseOperationException
- when query is invalid
-
selectAddOrderByDescFilter
protected final AbstractRequest selectAddOrderByDescFilter(java.lang.String... variableNames) throws InvalidParseOperationException
- Parameters:
variableNames
- list of key name- Returns:
- this Query
- Throws:
InvalidParseOperationException
- when query is invalid
-
selectAddOrderByFilter
protected final AbstractRequest selectAddOrderByFilter(com.fasterxml.jackson.databind.JsonNode filterContent) throws InvalidParseOperationException
- Parameters:
filterContent
- json filter- Returns:
- this Query
- Throws:
InvalidParseOperationException
- when query is invalid
-
selectParseOrderByFilter
protected final AbstractRequest selectParseOrderByFilter(java.lang.String filter) throws InvalidParseOperationException
- Parameters:
filter
- string filter- Returns:
- this Query
- Throws:
InvalidParseOperationException
- when query is invalid
-
selectSetFilter
protected final AbstractRequest selectSetFilter(com.fasterxml.jackson.databind.JsonNode filterContent) throws InvalidParseOperationException
- Throws:
InvalidParseOperationException
-
selectAddUsedProjection
protected final AbstractRequest selectAddUsedProjection(java.lang.String... variableNames) throws InvalidParseOperationException
- Parameters:
variableNames
- list of key name- Returns:
- this Query
- Throws:
InvalidParseOperationException
- when query is invalid
-
selectAddUnusedProjection
protected final AbstractRequest selectAddUnusedProjection(java.lang.String... variableNames) throws InvalidParseOperationException
- Parameters:
variableNames
- list of key name- Returns:
- this Query
- Throws:
InvalidParseOperationException
- when query is invalid
-
selectAddProjection
protected final AbstractRequest selectAddProjection(com.fasterxml.jackson.databind.JsonNode projectionContent)
- Parameters:
projectionContent
- json projection- Returns:
- this Query
-
selectParseProjection
protected final AbstractRequest selectParseProjection(java.lang.String projection) throws InvalidParseOperationException
- Parameters:
projection
- string projection- Returns:
- this Query
- Throws:
InvalidParseOperationException
- when query is invalid
-
selectSetProjection
protected AbstractRequest selectSetProjection(com.fasterxml.jackson.databind.JsonNode projectionContent) throws InvalidParseOperationException
- Parameters:
projectionContent
- json projection- Returns:
- this Query
- Throws:
InvalidParseOperationException
- when query is invalid
-
getFinal
protected abstract com.fasterxml.jackson.databind.node.ObjectNode getFinal()
Get the json final of request- Returns:
- the Final json containing all 2 parts: query and filter
-
selectGetFinalSelect
protected final com.fasterxml.jackson.databind.node.ObjectNode selectGetFinalSelect()
- Returns:
- the Final Select containing all 3 parts: query, filter and projection
-
selectGetAllProjection
protected boolean selectGetAllProjection()
- Returns:
- True if the projection is not restricted
-
selectGetProjection
protected com.fasterxml.jackson.databind.node.ObjectNode selectGetProjection()
- Returns:
- the projection
-
-