Package org.apache.jackrabbit.oak.query
Class QueryValidator
- java.lang.Object
-
- org.apache.jackrabbit.oak.query.QueryValidator
-
public class QueryValidator extends Object
A validator for query. Invalid queries either log a warning, or throw an exception when trying to execute.
-
-
Field Summary
Fields Modifier and Type Field Description static StringQUERY_VALIDATORThe name of the query validator node.
-
Constructor Summary
Constructors Constructor Description QueryValidator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcheckStatement(String statement)Check if a query is valid.StringgetJson()Get the current set of pattern data.voidinit(NodeStore store)voidsetPattern(String key, String pattern, String comment, boolean failQuery)Add a pattern.
-
-
-
Field Detail
-
QUERY_VALIDATOR
public static final String QUERY_VALIDATOR
The name of the query validator node.- See Also:
- Constant Field Values
-
-
Method Detail
-
setPattern
public void setPattern(String key, String pattern, String comment, boolean failQuery)
Add a pattern.- Parameters:
key- the keypattern- the pattern regular expression - if empty, the entry is removedcomment- the commentfailQuery- - if true, trying to run such a query will fail; otherwise the queries that will work, but will log a warning. A warning is logged at most once every 10 seconds.
-
getJson
public String getJson()
Get the current set of pattern data.- Returns:
- the json representation
-
checkStatement
public void checkStatement(String statement) throws ParseException
Check if a query is valid. It is either valid, logs a warning, or throws a exception if invalid.- Parameters:
statement- the query statement- Throws:
ParseException- if it is invalid
-
init
public void init(NodeStore store)
-
-