qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rgodf...@apache.org
Subject svn commit: r1722953 [1/3] - in /qpid/java/trunk: broker-core/src/main/java/org/apache/qpid/server/filter/ broker-plugins/management-http/ broker-plugins/management-http/src/main/grammar/ broker-plugins/management-http/src/main/java/org/apache/qpid/ser...
Date Mon, 04 Jan 2016 19:55:44 GMT
Author: rgodfrey
Date: Mon Jan  4 19:55:44 2016
New Revision: 1722953

URL: http://svn.apache.org/viewvc?rev=1722953&view=rev
Log:
QPID-6969 : Add SQL Like filtering mechanism to HTTP API

Added:
    qpid/java/trunk/broker-plugins/management-http/src/main/grammar/
    qpid/java/trunk/broker-plugins/management-http/src/main/grammar/ConfiguredObjectFilterParser.jj
    qpid/java/trunk/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/query/
    qpid/java/trunk/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/query/ConfiguredObjectExpression.java   (with props)
    qpid/java/trunk/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/query/ConfiguredObjectExpressionFactory.java   (with props)
    qpid/java/trunk/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/query/ConfiguredObjectFilterParser.java   (with props)
    qpid/java/trunk/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/query/ConfiguredObjectFilterParserConstants.java   (with props)
    qpid/java/trunk/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/query/ConfiguredObjectFilterParserTokenManager.java   (with props)
    qpid/java/trunk/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/query/NamedExpression.java   (with props)
    qpid/java/trunk/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/query/ParseException.java   (with props)
    qpid/java/trunk/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/query/SimpleCharStream.java   (with props)
    qpid/java/trunk/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/query/Token.java   (with props)
    qpid/java/trunk/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/query/TokenMgrError.java   (with props)
    qpid/java/trunk/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/BrokerQueryServlet.java   (with props)
    qpid/java/trunk/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/QueryServlet.java   (with props)
    qpid/java/trunk/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/VirtualHostQueryServlet.java   (with props)
    qpid/java/trunk/common/src/main/java/org/apache/qpid/filter/JMSMessagePropertyExpression.java
      - copied, changed from r1722330, qpid/java/trunk/common/src/main/java/org/apache/qpid/filter/PropertyExpression.java
    qpid/java/trunk/common/src/main/java/org/apache/qpid/filter/PropertyExpressionFactory.java   (with props)
Modified:
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/filter/JMSSelectorFilter.java
    qpid/java/trunk/broker-plugins/management-http/pom.xml
    qpid/java/trunk/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/HttpManagement.java
    qpid/java/trunk/common/pom.xml
    qpid/java/trunk/common/src/main/grammar/SelectorParser.jj
    qpid/java/trunk/common/src/main/java/org/apache/qpid/filter/ArithmeticExpression.java
    qpid/java/trunk/common/src/main/java/org/apache/qpid/filter/BinaryExpression.java
    qpid/java/trunk/common/src/main/java/org/apache/qpid/filter/BooleanExpression.java
    qpid/java/trunk/common/src/main/java/org/apache/qpid/filter/ComparisonExpression.java
    qpid/java/trunk/common/src/main/java/org/apache/qpid/filter/ConstantExpression.java
    qpid/java/trunk/common/src/main/java/org/apache/qpid/filter/Expression.java
    qpid/java/trunk/common/src/main/java/org/apache/qpid/filter/LogicExpression.java
    qpid/java/trunk/common/src/main/java/org/apache/qpid/filter/PropertyExpression.java
    qpid/java/trunk/common/src/main/java/org/apache/qpid/filter/UnaryExpression.java
    qpid/java/trunk/common/src/main/java/org/apache/qpid/filter/selector/SelectorParser.java
    qpid/java/trunk/common/src/main/java/org/apache/qpid/filter/selector/SelectorParserTokenManager.java

Modified: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/filter/JMSSelectorFilter.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/filter/JMSSelectorFilter.java?rev=1722953&r1=1722952&r2=1722953&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/filter/JMSSelectorFilter.java (original)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/filter/JMSSelectorFilter.java Mon Jan  4 19:55:44 2016
@@ -25,6 +25,8 @@ import org.slf4j.LoggerFactory;
 
 import org.apache.qpid.common.AMQPFilterTypes;
 import org.apache.qpid.filter.BooleanExpression;
+import org.apache.qpid.filter.FilterableMessage;
+import org.apache.qpid.filter.JMSMessagePropertyExpression;
 import org.apache.qpid.filter.SelectorParsingException;
 import org.apache.qpid.filter.selector.ParseException;
 import org.apache.qpid.filter.selector.SelectorParser;
@@ -43,7 +45,9 @@ public class JMSSelectorFilter implement
     public JMSSelectorFilter(String selector) throws ParseException, TokenMgrError, SelectorParsingException
     {
         _selector = selector;
-        _matcher = new SelectorParser().parse(selector);
+        SelectorParser<FilterableMessage> selectorParser = new SelectorParser<>();
+        selectorParser.setPropertyExpressionFactory(JMSMessagePropertyExpression.FACTORY);
+        _matcher = selectorParser.parse(selector);
     }
 
     @Override

Modified: qpid/java/trunk/broker-plugins/management-http/pom.xml
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-plugins/management-http/pom.xml?rev=1722953&r1=1722952&r2=1722953&view=diff
==============================================================================
--- qpid/java/trunk/broker-plugins/management-http/pom.xml (original)
+++ qpid/java/trunk/broker-plugins/management-http/pom.xml Mon Jan  4 19:55:44 2016
@@ -146,4 +146,42 @@
     </plugins>
   </build>
 
+
+  <profiles>
+    <profile>
+      <id>generate-sources-http-management</id>
+      <activation>
+        <property>
+          <name>generate</name>
+          <value>true</value>
+        </property>
+      </activation>
+      <build>
+        <plugins>
+          <plugin>
+            <groupId>org.codehaus.mojo</groupId>
+            <artifactId>javacc-maven-plugin</artifactId>
+            <!--version specified in parent pluginManagement -->
+            <executions>
+              <execution>
+                <id>jms-selector-generated</id>
+                <phase>generate-sources</phase>
+                <goals>
+                  <goal>javacc</goal>
+                </goals>
+                <configuration>
+                  <outputDirectory>src/main/java</outputDirectory>
+                  <sourceDirectory>src/main/grammar</sourceDirectory>
+                  <includes>
+                    <include>ConfiguredObjectFilterParser.jj</include>
+                  </includes>
+                </configuration>
+              </execution>
+            </executions>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
+  </profiles>
+
 </project>

Added: qpid/java/trunk/broker-plugins/management-http/src/main/grammar/ConfiguredObjectFilterParser.jj
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-plugins/management-http/src/main/grammar/ConfiguredObjectFilterParser.jj?rev=1722953&view=auto
==============================================================================
--- qpid/java/trunk/broker-plugins/management-http/src/main/grammar/ConfiguredObjectFilterParser.jj (added)
+++ qpid/java/trunk/broker-plugins/management-http/src/main/grammar/ConfiguredObjectFilterParser.jj Mon Jan  4 19:55:44 2016
@@ -0,0 +1,723 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+ //
+ // Original File from r450141 of the Apache ActiveMQ project <http://www.activemq.org/site/home.html>
+ //
+
+// ----------------------------------------------------------------------------
+// OPTIONS
+// ----------------------------------------------------------------------------
+options {
+  STATIC = false;
+  UNICODE_INPUT = true;
+
+  // some performance optimizations
+  ERROR_REPORTING = false;
+}
+
+// ----------------------------------------------------------------------------
+// PARSER
+// ----------------------------------------------------------------------------
+
+PARSER_BEGIN(ConfiguredObjectFilterParser)
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.qpid.server.management.plugin.servlet.query;
+
+import java.io.StringReader;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.Collections;
+
+import org.apache.qpid.filter.ArithmeticExpression;
+import org.apache.qpid.filter.BooleanExpression;
+import org.apache.qpid.filter.ComparisonExpression;
+import org.apache.qpid.filter.ConstantExpression;
+import org.apache.qpid.filter.Expression;
+import org.apache.qpid.filter.LogicExpression;
+import org.apache.qpid.filter.UnaryExpression;
+
+import org.apache.qpid.server.model.ConfiguredObject;
+
+/**
+ * JMS Selector Parser generated by JavaCC
+ *
+ * Do not edit this .java file directly - it is autogenerated from SelectorParser.jj
+ */
+public class ConfiguredObjectFilterParser
+{
+    private ConfiguredObjectExpressionFactory _factory;
+    private boolean _allowNonPropertyInExpressions;
+
+
+    public ConfiguredObjectFilterParser()
+    {
+        this(new StringReader(""));
+    }
+
+    public void setConfiguredObjectExpressionFactory(ConfiguredObjectExpressionFactory factory)
+    {
+        _factory = factory;
+    }
+
+    public void allowNonPropertyInExpressions(boolean allow)
+    {
+      _allowNonPropertyInExpressions = allow;
+    }
+
+    public BooleanExpression<ConfiguredObject> parseWhere(String sql) throws ParseException
+    {
+        this.ReInit(new StringReader(sql));
+
+        return filter();
+
+    }
+
+
+    public List<Map<String,Expression>> parseSelect(String sql) throws ParseException
+    {
+        this.ReInit(new StringReader(sql));
+
+        return selectClause();
+
+    }
+
+    private BooleanExpression<ConfiguredObject<?>> asBooleanExpression(Expression<ConfiguredObject<?>> value) throws ParseException
+    {
+        if (value instanceof BooleanExpression)
+        {
+            return (BooleanExpression<ConfiguredObject<?>>) value;
+        }
+        if (value instanceof ConfiguredObjectExpression)
+        {
+            return UnaryExpression.createBooleanCast( (Expression<ConfiguredObject<?>>) value );
+        }
+        throw new ParseException("Expression will not result in a boolean value: " + value);
+    }
+
+
+}
+
+PARSER_END(ConfiguredObjectFilterParser)
+
+// ----------------------------------------------------------------------------
+// Tokens
+// ----------------------------------------------------------------------------
+
+/* White Space */
+SPECIAL_TOKEN :
+{
+  " " | "\t" | "\n" | "\r" | "\f"
+}
+
+/* Comments */
+SKIP:
+{
+  <LINE_COMMENT: "--" (~["\n","\r"])* ("\n"|"\r"|"\r\n") >
+}
+
+SKIP:
+{
+  <BLOCK_COMMENT: "/*" (~["*"])* "*" ("*" | (~["*","/"] (~["*"])* "*"))* "/">
+}
+
+/* Reserved Words */
+TOKEN [IGNORE_CASE] :
+{
+    <  NOT     : "NOT">
+  | <  AND     : "AND">
+  | <  OR      : "OR">
+  | <  BETWEEN : "BETWEEN">
+  | <  LIKE    : "LIKE">
+  | <  ESCAPE  : "ESCAPE">
+  | <  IN      : "IN">
+  | <  IS      : "IS">
+  | <  TRUE    : "TRUE" >
+  | <  FALSE   : "FALSE" >
+  | <  NULL    : "NULL" >
+  | <  AS      : "AS">
+
+}
+
+/* Literals */
+TOKEN [IGNORE_CASE] :
+{
+
+    < DECIMAL_LITERAL: ["1"-"9"] (["0"-"9"])* (["l","L"])? >
+  | < HEX_LITERAL: "0" ["x","X"] (["0"-"9","a"-"f","A"-"F"])+ >
+  | < OCTAL_LITERAL: "0" (["0"-"7"])* >
+  | < FLOATING_POINT_LITERAL:
+          (["0"-"9"])+ "." (["0"-"9"])* (<EXPONENT>)? // matches: 5.5 or 5. or 5.5E10 or 5.E10
+        | "." (["0"-"9"])+ (<EXPONENT>)?              // matches: .5 or .5E10
+        | (["0"-"9"])+ <EXPONENT>                     // matches: 5E10
+    >
+  | < #EXPONENT: "E" (["+","-"])? (["0"-"9"])+ >
+  | < STRING_LITERAL: "'" ( ("''") | ~["'"] )*  "'" >
+  | < FUNCTIONNAME : ["a"-"z", "_", "A"-"Z"] (["a"-"z","A"-"Z", "0"-"9","_"])* "(" >
+}
+
+TOKEN [IGNORE_CASE] :
+{
+    < ID : ["a"-"z", "_", "$"] (["a"-"z","0"-"9","_", "$"])* >
+    | < QUOTED_ID : "\"" ( ("\"\"") | ~["\""] )*  "\""  >
+}
+
+// ----------------------------------------------------------------------------
+// Grammer
+// ----------------------------------------------------------------------------
+BooleanExpression filter() :
+{
+    Expression left=null;
+}
+{
+    (
+        left = orExpression()
+    )
+    {
+        return asBooleanExpression(left);
+    }
+
+}
+
+Expression orExpression() :
+{
+    Expression left;
+    Expression right;
+}
+{
+    (
+        left = andExpression()
+        (
+            <OR> right = andExpression()
+            {
+                left = LogicExpression.createOR(asBooleanExpression(left), asBooleanExpression(right));
+            }
+        )*
+    )
+    {
+        return left;
+    }
+
+}
+
+
+Expression andExpression() :
+{
+    Expression left;
+    Expression right;
+}
+{
+    (
+        left = equalityExpression()
+        (
+            <AND> right = equalityExpression()
+            {
+                left = LogicExpression.createAND(asBooleanExpression(left), asBooleanExpression(right));
+            }
+        )*
+    )
+    {
+        return left;
+    }
+}
+
+Expression equalityExpression() :
+{
+    Expression left;
+    Expression right;
+}
+{
+    (
+        left = comparisonExpression()
+        (
+
+            "=" right = comparisonExpression()
+            {
+                left = ComparisonExpression.createEqual(left, right);
+            }
+            |
+            "<>" right = comparisonExpression()
+            {
+                left = ComparisonExpression.createNotEqual(left, right);
+            }
+            |
+            LOOKAHEAD(2)
+            <IS> <NULL>
+            {
+                left = ComparisonExpression.createIsNull(left);
+            }
+            |
+            <IS> <NOT> <NULL>
+            {
+                left = ComparisonExpression.createIsNotNull(left);
+            }
+        )*
+    )
+    {
+        return left;
+    }
+}
+
+Expression comparisonExpression() :
+{
+    Expression left;
+    Expression right;
+    Expression low;
+    Expression high;
+    String t, u;
+	boolean not;
+	ArrayList list;
+}
+{
+    (
+        left = addExpression()
+        (
+
+                ">" right = addExpression()
+                {
+                    left = ComparisonExpression.createGreaterThan(left, right);
+                }
+            |
+                ">=" right = addExpression()
+                {
+                    left = ComparisonExpression.createGreaterThanEqual(left, right);
+                }
+            |
+                "<" right = addExpression()
+                {
+                    left = ComparisonExpression.createLessThan(left, right);
+                }
+            |
+                "<=" right = addExpression()
+                {
+                    left = ComparisonExpression.createLessThanEqual(left, right);
+                }
+           |
+				{
+					u=null;
+				}
+		        <LIKE> t = stringLiteral()
+		        	[ <ESCAPE> u = stringLiteral() ]
+		        {
+                    left = ComparisonExpression.createLike(left, t, u);
+		        }
+           |
+	        	LOOKAHEAD(2)
+				{
+					u=null;
+				}
+		        <NOT> <LIKE> t = stringLiteral() [ <ESCAPE> u = stringLiteral() ]
+		        {
+                    left = ComparisonExpression.createNotLike(left, t, u);
+		        }
+            |
+		        <BETWEEN> low = addExpression() <AND> high = addExpression()
+		        {
+					left = ComparisonExpression.createBetween(left, low, high);
+		        }
+	        |
+	        	LOOKAHEAD(2)
+		        <NOT> <BETWEEN> low = addExpression() <AND> high = addExpression()
+		        {
+					left = ComparisonExpression.createNotBetween(left, low, high);
+		        }
+            |
+				<IN>
+		        "("
+		            right = primaryExpr()
+		            {
+			            list = new ArrayList();
+			            list.add( right );
+		            }
+			        (
+			        	","
+			            right = primaryExpr()
+			            {
+				            list.add( right );
+			            }
+
+			        )*
+		        ")"
+		        {
+		           left = ComparisonExpression.createInFilter(left, list, _allowNonPropertyInExpressions );
+		        }
+            |
+	        	LOOKAHEAD(2)
+	            <NOT> <IN>
+		        "("
+		            right = primaryExpr()
+		            {
+			            list = new ArrayList();
+			            list.add( right );
+		            }
+			        (
+			        	","
+			            right = primaryExpr()
+			            {
+				            list.add( right );
+			            }
+
+			        )*
+		        ")"
+		        {
+		           left = ComparisonExpression.createNotInFilter(left, list, _allowNonPropertyInExpressions);
+		        }
+
+        )*
+    )
+    {
+        return left;
+    }
+}
+
+Expression addExpression() :
+{
+    Expression left;
+    Expression right;
+}
+{
+    left = multExpr()
+    (
+	    LOOKAHEAD( ("+"|"-") multExpr())
+	    (
+	        "+" right = multExpr()
+	        {
+	            left = ArithmeticExpression.createPlus(left, right);
+	        }
+	        |
+	        "-" right = multExpr()
+	        {
+	            left = ArithmeticExpression.createMinus(left, right);
+	        }
+        )
+
+    )*
+    {
+        return left;
+    }
+}
+
+Expression multExpr() :
+{
+    Expression left;
+    Expression right;
+}
+{
+    left = unaryExpr()
+    (
+        "*" right = unaryExpr()
+        {
+	        left = ArithmeticExpression.createMultiply(left, right);
+        }
+        |
+        "/" right = unaryExpr()
+        {
+	        left = ArithmeticExpression.createDivide(left, right);
+        }
+        |
+        "%" right = unaryExpr()
+        {
+	        left = ArithmeticExpression.createMod(left, right);
+        }
+
+    )*
+    {
+        return left;
+    }
+}
+
+
+Expression unaryExpr() :
+{
+    String s=null;
+    Expression left=null;
+}
+{
+	(
+		LOOKAHEAD( "+" unaryExpr() )
+	    "+" left=unaryExpr()
+	    |
+	    "-" left=unaryExpr()
+	    {
+	        left = UnaryExpression.createNegate(left);
+	    }
+	    |
+	    <NOT> left=unaryExpr()
+	    {
+		    left = UnaryExpression.createNOT( asBooleanExpression(left) );
+	    }
+	    |
+	    left = primaryExpr()
+    )
+    {
+        return left;
+    }
+
+}
+
+Expression primaryExpr() :
+{
+    Expression left=null;
+}
+{
+    (
+        left = functionExpression()
+        |
+        left = literal()
+        |
+        left = variable()
+        |
+        "(" left = orExpression() ")"
+        )
+
+    {
+        return left;
+    }
+}
+
+
+
+ConstantExpression literal() :
+{
+    Token t;
+    String s;
+    ConstantExpression left=null;
+}
+{
+    (
+        (
+            s = stringLiteral()
+            {
+                left = new ConstantExpression(s);
+            }
+        )
+        |
+        (
+            t = <DECIMAL_LITERAL>
+            {
+            	left = ConstantExpression.createFromDecimal(t.image);
+            }
+        )
+        |
+        (
+            t = <HEX_LITERAL>
+            {
+            	left = ConstantExpression.createFromHex(t.image);
+            }
+        )
+        |
+        (
+            t = <OCTAL_LITERAL>
+            {
+            	left = ConstantExpression.createFromOctal(t.image);
+            }
+        )
+        |
+        (
+            t = <FLOATING_POINT_LITERAL>
+            {
+            	left = ConstantExpression.createFloat(t.image);
+            }
+        )
+        |
+        (
+            <TRUE>
+            {
+                left = ConstantExpression.TRUE;
+            }
+        )
+        |
+        (
+            <FALSE>
+            {
+                left = ConstantExpression.FALSE;
+            }
+        )
+        |
+        (
+            <NULL>
+            {
+                left = ConstantExpression.NULL;
+            }
+        )
+    )
+    {
+        return left;
+    }
+}
+
+String stringLiteral() :
+{
+    Token t;
+    StringBuffer rc = new StringBuffer();
+    boolean first=true;
+}
+{
+    t = <STRING_LITERAL>
+    {
+    	// Decode the sting value.
+    	String image = t.image;
+    	for( int i=1; i < image.length()-1; i++ ) {
+            char c = image.charAt(i);
+            if( c == (char) 0x27 )//single quote
+            {
+                i++;
+            }
+            rc.append(c);
+    	}
+	    return rc.toString();
+    }
+}
+
+ConfiguredObjectExpression variable() :
+{
+    String s;
+    Token t;
+    ConfiguredObjectExpression right;
+}
+{
+    LOOKAHEAD(2)
+    (
+        s = identifier() "."  right = variable()
+    )
+    {
+        return _factory.createConfiguredObjectExpression( s, right );
+    }
+    |
+    LOOKAHEAD(2)
+    (
+        s = identifier() "[" t = <DECIMAL_LITERAL> "]"
+    )
+    {
+        return _factory.createConfiguredObjectExpression( s, Integer.valueOf( t.image ) );
+    }
+    |
+    (
+        s = identifier()
+    )
+    {
+        return _factory.createConfiguredObjectExpression( s );
+    }
+
+}
+
+Expression functionExpression() :
+{
+    String s;
+    Token t;
+    List<Expression> args = new ArrayList<Expression>();
+    Expression expr;
+}
+{
+    (
+        t = <FUNCTIONNAME> ( expr = primaryExpr() { args.add(expr); } ( "," expr = primaryExpr() { args.add(expr); } )* )? ")"
+    )
+    {
+        return _factory.createFunctionExpression( t.image.substring(0, t.image.length() - 1), args );
+    }
+}
+
+String identifier() :
+{
+    Token t;
+    StringBuffer rc = new StringBuffer();
+    String s;
+}
+{
+    (
+        t = <ID>
+        {
+            s = t.image;
+        }
+        |
+        t = <QUOTED_ID>
+        {
+            // Decode the sting value.
+            String image = t.image;
+            for( int i=1; i < image.length()-1; i++ ) {
+                char c = image.charAt(i);
+                if( c == '"' )
+                {
+                    i++;
+                }
+                rc.append(c);
+            }
+            s = rc.toString();
+        }
+
+
+    )
+    {
+        return s;
+    }
+}
+
+List<Map<String, Expression>> selectClause() :
+{
+    List<Map<String, Expression>> returnVal = new ArrayList<Map<String, Expression>>();
+    Map<String, Expression> element;
+}
+{
+    ( element = selectClauseElement() { returnVal.add( element ); }
+    ) ( "," element = selectClauseElement() { returnVal.add( element ); } )*
+    {
+        return returnVal;
+    }
+}
+
+Map<String, Expression> selectClauseElement() :
+{
+    String name = null;
+    Expression expr;
+
+}
+{
+    ( expr = primaryExpr() ( <AS> name = identifier() )?
+      {
+          if(name == null)
+          {
+              name = ( expr instanceof NamedExpression ) ?  ((NamedExpression) expr).getName() : "";
+          }
+          return Collections.singletonMap( name, expr );
+      }
+    )
+}

Modified: qpid/java/trunk/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/HttpManagement.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/HttpManagement.java?rev=1722953&r1=1722952&r2=1722953&view=diff
==============================================================================
--- qpid/java/trunk/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/HttpManagement.java (original)
+++ qpid/java/trunk/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/HttpManagement.java Mon Jan  4 19:55:44 2016
@@ -73,6 +73,7 @@ import org.apache.qpid.server.management
 import org.apache.qpid.server.management.plugin.servlet.FileServlet;
 import org.apache.qpid.server.management.plugin.servlet.RootServlet;
 import org.apache.qpid.server.management.plugin.servlet.rest.ApiDocsServlet;
+import org.apache.qpid.server.management.plugin.servlet.rest.BrokerQueryServlet;
 import org.apache.qpid.server.management.plugin.servlet.rest.JsonValueServlet;
 import org.apache.qpid.server.management.plugin.servlet.rest.LoggedOnUserPreferencesServlet;
 import org.apache.qpid.server.management.plugin.servlet.rest.LogoutServlet;
@@ -83,6 +84,7 @@ import org.apache.qpid.server.management
 import org.apache.qpid.server.management.plugin.servlet.rest.StructureServlet;
 import org.apache.qpid.server.management.plugin.servlet.rest.TimeZoneServlet;
 import org.apache.qpid.server.management.plugin.servlet.rest.UserPreferencesServlet;
+import org.apache.qpid.server.management.plugin.servlet.rest.VirtualHostQueryServlet;
 import org.apache.qpid.server.model.*;
 import org.apache.qpid.server.model.adapter.AbstractPluginAdapter;
 import org.apache.qpid.server.model.port.HttpPort;
@@ -262,6 +264,15 @@ public class HttpManagement extends Abst
 
         addRestServlet(root, Broker.class);
 
+        ServletHolder queryServlet = new ServletHolder(new BrokerQueryServlet());
+        root.addServlet(queryServlet, "/api/latest/querybroker/*");
+        root.addServlet(queryServlet, "/api/v" + BrokerModel.MODEL_MAJOR_VERSION + "/querybroker/*");
+
+        ServletHolder vhQueryServlet = new ServletHolder(new VirtualHostQueryServlet());
+        root.addServlet(vhQueryServlet, "/api/latest/queryvhost/*");
+        root.addServlet(vhQueryServlet, "/api/v" + BrokerModel.MODEL_MAJOR_VERSION + "/queryvhost/*");
+
+
         ServletHolder apiDocsServlet = new ServletHolder(new ApiDocsServlet(getModel()));
         final ServletHolder rewriteSerlvet = new ServletHolder(new RewriteServlet("^(.*)$", "$1/"));
         for(String path : new String[]{"/apidocs", "/apidocs/latest", "/apidocs/"+getLatestSupportedVersion()})

Added: qpid/java/trunk/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/query/ConfiguredObjectExpression.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/query/ConfiguredObjectExpression.java?rev=1722953&view=auto
==============================================================================
--- qpid/java/trunk/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/query/ConfiguredObjectExpression.java (added)
+++ qpid/java/trunk/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/query/ConfiguredObjectExpression.java Mon Jan  4 19:55:44 2016
@@ -0,0 +1,28 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.qpid.server.management.plugin.servlet.query;
+
+import org.apache.qpid.filter.Expression;
+import org.apache.qpid.server.model.ConfiguredObject;
+
+public interface ConfiguredObjectExpression extends Expression<ConfiguredObject<?>>
+{
+}

Propchange: qpid/java/trunk/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/query/ConfiguredObjectExpression.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: qpid/java/trunk/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/query/ConfiguredObjectExpressionFactory.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/query/ConfiguredObjectExpressionFactory.java?rev=1722953&view=auto
==============================================================================
--- qpid/java/trunk/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/query/ConfiguredObjectExpressionFactory.java (added)
+++ qpid/java/trunk/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/query/ConfiguredObjectExpressionFactory.java Mon Jan  4 19:55:44 2016
@@ -0,0 +1,203 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.qpid.server.management.plugin.servlet.query;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.EnumSet;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.qpid.filter.Expression;
+import org.apache.qpid.server.model.ConfiguredObject;
+
+public class ConfiguredObjectExpressionFactory
+{
+
+    private static final String PARENT_ATTR = "$parent";
+    private static Set<String> SPECIAL_ATTRIBUTES = new HashSet<>(Arrays.asList(PARENT_ATTR));
+
+
+    enum FilterFunction
+    {
+        CONCAT {
+            @Override
+            ConfiguredObjectExpression asExpression(final List<Expression> args)
+            {
+                return new ConfiguredObjectExpression()
+                {
+                    @Override
+                    public Object evaluate(final ConfiguredObject<?> object)
+                    {
+                        StringBuilder buf = new StringBuilder();
+                        for(Expression expr : args)
+                        {
+                            buf.append(expr.evaluate(object));
+                        }
+                        return buf.toString();
+                    }
+                };
+            }
+        };
+
+        abstract ConfiguredObjectExpression asExpression( List<Expression> args );
+    }
+
+
+    public ConfiguredObjectExpression createConfiguredObjectExpression(final String propertyName)
+    {
+        return new ConfiguredObjectPropertyExpression(propertyName);
+    }
+
+    public ConfiguredObjectExpression createConfiguredObjectExpression(final String propertyName,
+                                                                       final ConfiguredObjectExpression expression)
+    {
+        return new ChainedConfiguredObjectExpression(propertyName, expression);
+    }
+
+
+    public ConfiguredObjectExpression createConfiguredObjectExpression(final String propertyName,
+                                                                       final int index)
+    {
+        return new IndexedConfiguredObjectExpression(propertyName, index);
+    }
+
+    public ConfiguredObjectExpression createFunctionExpression(String functionName, final List<Expression> args)
+            throws ParseException
+    {
+        try
+        {
+            FilterFunction function = FilterFunction.valueOf(functionName.toUpperCase());
+            return function.asExpression(args);
+        }
+        catch(IllegalArgumentException e)
+        {
+            throw new ParseException("Unknown function name " + functionName);
+        }
+    }
+
+    private static class ConfiguredObjectPropertyExpression implements ConfiguredObjectExpression, NamedExpression<ConfiguredObject<?>>
+    {
+
+        private final String _propertyName;
+
+        public ConfiguredObjectPropertyExpression(final String propertyName)
+        {
+            _propertyName = propertyName;
+        }
+
+        @Override
+        public Object evaluate(final ConfiguredObject<?> object)
+        {
+            return object == null ? null : getValue(object);
+        }
+
+        private Object getValue(final ConfiguredObject<?> object)
+        {
+
+            if(SPECIAL_ATTRIBUTES.contains(_propertyName))
+            {
+                if(PARENT_ATTR.equals(_propertyName))
+                {
+                    return object.getParent(object.getModel().getParentTypes(object.getCategoryClass()).iterator().next());
+                }
+                else
+                {
+                    return null;
+                }
+            }
+            else
+            {
+                return object.getAttributeNames().contains(_propertyName)
+                        ? object.getAttribute(_propertyName)
+                        : object.getStatistics().get(_propertyName);
+            }
+        }
+
+        @Override
+        public String getName()
+        {
+            return _propertyName;
+        }
+    }
+
+    private static class ChainedConfiguredObjectExpression implements ConfiguredObjectExpression
+    {
+        private final ConfiguredObjectPropertyExpression _first;
+        private final ConfiguredObjectExpression _chainedExpression;
+
+        public ChainedConfiguredObjectExpression(final String propertyName, final ConfiguredObjectExpression expression)
+        {
+            _first = new ConfiguredObjectPropertyExpression(propertyName);
+            _chainedExpression = expression;
+        }
+
+        @Override
+        public Object evaluate(final ConfiguredObject<?> object)
+        {
+            Object propertyValue = _first.evaluate(object);
+            if(propertyValue instanceof ConfiguredObject)
+            {
+                return _chainedExpression.evaluate((ConfiguredObject)propertyValue);
+            }
+            else if(propertyValue instanceof Map && _chainedExpression instanceof ConfiguredObjectPropertyExpression)
+            {
+                return ((Map) propertyValue).get(((ConfiguredObjectPropertyExpression)_chainedExpression)._propertyName);
+            }
+            return null;
+        }
+    }
+
+    private static class IndexedConfiguredObjectExpression implements ConfiguredObjectExpression
+    {
+        private final String _propertyName;
+        private final int _index;
+
+        public IndexedConfiguredObjectExpression(final String propertyName, final int index)
+        {
+            _propertyName = propertyName;
+            _index = index;
+        }
+
+        @Override
+        public Object evaluate(final ConfiguredObject<?> object)
+        {
+            Object propertyValue = object == null ? null : object.getAttribute(_propertyName);
+            if(propertyValue instanceof Collection)
+            {
+                Iterator iter = ((Collection)propertyValue).iterator();
+                int pos = 0;
+                while(iter.hasNext() && pos < _index)
+                {
+                    iter.next();
+                }
+                if(pos == _index && iter.hasNext())
+                {
+                    return iter.next();
+                }
+            }
+            return null;
+        }
+    }
+}

Propchange: qpid/java/trunk/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/query/ConfiguredObjectExpressionFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: qpid/java/trunk/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/query/ConfiguredObjectFilterParser.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/query/ConfiguredObjectFilterParser.java?rev=1722953&view=auto
==============================================================================
--- qpid/java/trunk/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/query/ConfiguredObjectFilterParser.java (added)
+++ qpid/java/trunk/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/query/ConfiguredObjectFilterParser.java Mon Jan  4 19:55:44 2016
@@ -0,0 +1,1447 @@
+/* Generated By:JavaCC: Do not edit this line. ConfiguredObjectFilterParser.java */
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.qpid.server.management.plugin.servlet.query;
+
+import java.io.StringReader;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.Collections;
+
+import org.apache.qpid.filter.ArithmeticExpression;
+import org.apache.qpid.filter.BooleanExpression;
+import org.apache.qpid.filter.ComparisonExpression;
+import org.apache.qpid.filter.ConstantExpression;
+import org.apache.qpid.filter.Expression;
+import org.apache.qpid.filter.LogicExpression;
+import org.apache.qpid.filter.UnaryExpression;
+
+import org.apache.qpid.server.model.ConfiguredObject;
+
+/**
+ * JMS Selector Parser generated by JavaCC
+ *
+ * Do not edit this .java file directly - it is autogenerated from SelectorParser.jj
+ */
+public class ConfiguredObjectFilterParser implements ConfiguredObjectFilterParserConstants {
+    private ConfiguredObjectExpressionFactory _factory;
+    private boolean _allowNonPropertyInExpressions;
+
+
+    public ConfiguredObjectFilterParser()
+    {
+        this(new StringReader(""));
+    }
+
+    public void setConfiguredObjectExpressionFactory(ConfiguredObjectExpressionFactory factory)
+    {
+        _factory = factory;
+    }
+
+    public void allowNonPropertyInExpressions(boolean allow)
+    {
+      _allowNonPropertyInExpressions = allow;
+    }
+
+    public BooleanExpression<ConfiguredObject> parseWhere(String sql) throws ParseException
+    {
+        this.ReInit(new StringReader(sql));
+
+        return filter();
+
+    }
+
+
+    public List<Map<String,Expression>> parseSelect(String sql) throws ParseException
+    {
+        this.ReInit(new StringReader(sql));
+
+        return selectClause();
+
+    }
+
+    private BooleanExpression<ConfiguredObject<?>> asBooleanExpression(Expression<ConfiguredObject<?>> value) throws ParseException
+    {
+        if (value instanceof BooleanExpression)
+        {
+            return (BooleanExpression<ConfiguredObject<?>>) value;
+        }
+        if (value instanceof ConfiguredObjectExpression)
+        {
+            return UnaryExpression.createBooleanCast( (Expression<ConfiguredObject<?>>) value );
+        }
+        throw new ParseException("Expression will not result in a boolean value: " + value);
+    }
+
+// ----------------------------------------------------------------------------
+// Grammer
+// ----------------------------------------------------------------------------
+  final public BooleanExpression filter() throws ParseException {
+    Expression left=null;
+    left = orExpression();
+        {if (true) return asBooleanExpression(left);}
+    throw new Error("Missing return statement in function");
+  }
+
+  final public Expression orExpression() throws ParseException {
+    Expression left;
+    Expression right;
+    left = andExpression();
+    label_1:
+    while (true) {
+      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+      case OR:
+        ;
+        break;
+      default:
+        break label_1;
+      }
+      jj_consume_token(OR);
+      right = andExpression();
+                left = LogicExpression.createOR(asBooleanExpression(left), asBooleanExpression(right));
+    }
+        {if (true) return left;}
+    throw new Error("Missing return statement in function");
+  }
+
+  final public Expression andExpression() throws ParseException {
+    Expression left;
+    Expression right;
+    left = equalityExpression();
+    label_2:
+    while (true) {
+      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+      case AND:
+        ;
+        break;
+      default:
+        break label_2;
+      }
+      jj_consume_token(AND);
+      right = equalityExpression();
+                left = LogicExpression.createAND(asBooleanExpression(left), asBooleanExpression(right));
+    }
+        {if (true) return left;}
+    throw new Error("Missing return statement in function");
+  }
+
+  final public Expression equalityExpression() throws ParseException {
+    Expression left;
+    Expression right;
+    left = comparisonExpression();
+    label_3:
+    while (true) {
+      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+      case IS:
+      case 29:
+      case 30:
+        ;
+        break;
+      default:
+        break label_3;
+      }
+      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+      case 29:
+        jj_consume_token(29);
+        right = comparisonExpression();
+                left = ComparisonExpression.createEqual(left, right);
+        break;
+      case 30:
+        jj_consume_token(30);
+        right = comparisonExpression();
+                left = ComparisonExpression.createNotEqual(left, right);
+        break;
+      default:
+        if (jj_2_1(2)) {
+          jj_consume_token(IS);
+          jj_consume_token(NULL);
+                left = ComparisonExpression.createIsNull(left);
+        } else {
+          switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+          case IS:
+            jj_consume_token(IS);
+            jj_consume_token(NOT);
+            jj_consume_token(NULL);
+                left = ComparisonExpression.createIsNotNull(left);
+            break;
+          default:
+            jj_consume_token(-1);
+            throw new ParseException();
+          }
+        }
+      }
+    }
+        {if (true) return left;}
+    throw new Error("Missing return statement in function");
+  }
+
+  final public Expression comparisonExpression() throws ParseException {
+    Expression left;
+    Expression right;
+    Expression low;
+    Expression high;
+    String t, u;
+        boolean not;
+        ArrayList list;
+    left = addExpression();
+    label_4:
+    while (true) {
+      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+      case NOT:
+      case BETWEEN:
+      case LIKE:
+      case IN:
+      case 31:
+      case 32:
+      case 33:
+      case 34:
+        ;
+        break;
+      default:
+        break label_4;
+      }
+      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+      case 31:
+        jj_consume_token(31);
+        right = addExpression();
+                    left = ComparisonExpression.createGreaterThan(left, right);
+        break;
+      case 32:
+        jj_consume_token(32);
+        right = addExpression();
+                    left = ComparisonExpression.createGreaterThanEqual(left, right);
+        break;
+      case 33:
+        jj_consume_token(33);
+        right = addExpression();
+                    left = ComparisonExpression.createLessThan(left, right);
+        break;
+      case 34:
+        jj_consume_token(34);
+        right = addExpression();
+                    left = ComparisonExpression.createLessThanEqual(left, right);
+        break;
+      case LIKE:
+                                        u=null;
+        jj_consume_token(LIKE);
+        t = stringLiteral();
+        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+        case ESCAPE:
+          jj_consume_token(ESCAPE);
+          u = stringLiteral();
+          break;
+        default:
+          ;
+        }
+                    left = ComparisonExpression.createLike(left, t, u);
+        break;
+      default:
+        if (jj_2_2(2)) {
+                                        u=null;
+          jj_consume_token(NOT);
+          jj_consume_token(LIKE);
+          t = stringLiteral();
+          switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+          case ESCAPE:
+            jj_consume_token(ESCAPE);
+            u = stringLiteral();
+            break;
+          default:
+            ;
+          }
+                    left = ComparisonExpression.createNotLike(left, t, u);
+        } else {
+          switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+          case BETWEEN:
+            jj_consume_token(BETWEEN);
+            low = addExpression();
+            jj_consume_token(AND);
+            high = addExpression();
+                                        left = ComparisonExpression.createBetween(left, low, high);
+            break;
+          default:
+            if (jj_2_3(2)) {
+              jj_consume_token(NOT);
+              jj_consume_token(BETWEEN);
+              low = addExpression();
+              jj_consume_token(AND);
+              high = addExpression();
+                                        left = ComparisonExpression.createNotBetween(left, low, high);
+            } else {
+              switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+              case IN:
+                jj_consume_token(IN);
+                jj_consume_token(35);
+                right = primaryExpr();
+                                    list = new ArrayList();
+                                    list.add( right );
+                label_5:
+                while (true) {
+                  switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+                  case 36:
+                    ;
+                    break;
+                  default:
+                    break label_5;
+                  }
+                  jj_consume_token(36);
+                  right = primaryExpr();
+                                            list.add( right );
+                }
+                jj_consume_token(37);
+                           left = ComparisonExpression.createInFilter(left, list, _allowNonPropertyInExpressions );
+                break;
+              default:
+                if (jj_2_4(2)) {
+                  jj_consume_token(NOT);
+                  jj_consume_token(IN);
+                  jj_consume_token(35);
+                  right = primaryExpr();
+                                    list = new ArrayList();
+                                    list.add( right );
+                  label_6:
+                  while (true) {
+                    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+                    case 36:
+                      ;
+                      break;
+                    default:
+                      break label_6;
+                    }
+                    jj_consume_token(36);
+                    right = primaryExpr();
+                                            list.add( right );
+                  }
+                  jj_consume_token(37);
+                           left = ComparisonExpression.createNotInFilter(left, list, _allowNonPropertyInExpressions);
+                } else {
+                  jj_consume_token(-1);
+                  throw new ParseException();
+                }
+              }
+            }
+          }
+        }
+      }
+    }
+        {if (true) return left;}
+    throw new Error("Missing return statement in function");
+  }
+
+  final public Expression addExpression() throws ParseException {
+    Expression left;
+    Expression right;
+    left = multExpr();
+    label_7:
+    while (true) {
+      if (jj_2_5(2147483647)) {
+        ;
+      } else {
+        break label_7;
+      }
+      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+      case 38:
+        jj_consume_token(38);
+        right = multExpr();
+                    left = ArithmeticExpression.createPlus(left, right);
+        break;
+      case 39:
+        jj_consume_token(39);
+        right = multExpr();
+                    left = ArithmeticExpression.createMinus(left, right);
+        break;
+      default:
+        jj_consume_token(-1);
+        throw new ParseException();
+      }
+    }
+        {if (true) return left;}
+    throw new Error("Missing return statement in function");
+  }
+
+  final public Expression multExpr() throws ParseException {
+    Expression left;
+    Expression right;
+    left = unaryExpr();
+    label_8:
+    while (true) {
+      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+      case 40:
+      case 41:
+      case 42:
+        ;
+        break;
+      default:
+        break label_8;
+      }
+      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+      case 40:
+        jj_consume_token(40);
+        right = unaryExpr();
+                left = ArithmeticExpression.createMultiply(left, right);
+        break;
+      case 41:
+        jj_consume_token(41);
+        right = unaryExpr();
+                left = ArithmeticExpression.createDivide(left, right);
+        break;
+      case 42:
+        jj_consume_token(42);
+        right = unaryExpr();
+                left = ArithmeticExpression.createMod(left, right);
+        break;
+      default:
+        jj_consume_token(-1);
+        throw new ParseException();
+      }
+    }
+        {if (true) return left;}
+    throw new Error("Missing return statement in function");
+  }
+
+  final public Expression unaryExpr() throws ParseException {
+    String s=null;
+    Expression left=null;
+    if (jj_2_6(2147483647)) {
+      jj_consume_token(38);
+      left = unaryExpr();
+    } else {
+      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+      case 39:
+        jj_consume_token(39);
+        left = unaryExpr();
+                left = UnaryExpression.createNegate(left);
+        break;
+      case NOT:
+        jj_consume_token(NOT);
+        left = unaryExpr();
+                    left = UnaryExpression.createNOT( asBooleanExpression(left) );
+        break;
+      case TRUE:
+      case FALSE:
+      case NULL:
+      case DECIMAL_LITERAL:
+      case HEX_LITERAL:
+      case OCTAL_LITERAL:
+      case FLOATING_POINT_LITERAL:
+      case STRING_LITERAL:
+      case FUNCTIONNAME:
+      case ID:
+      case QUOTED_ID:
+      case 35:
+        left = primaryExpr();
+        break;
+      default:
+        jj_consume_token(-1);
+        throw new ParseException();
+      }
+    }
+        {if (true) return left;}
+    throw new Error("Missing return statement in function");
+  }
+
+  final public Expression primaryExpr() throws ParseException {
+    Expression left=null;
+    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+    case FUNCTIONNAME:
+      left = functionExpression();
+      break;
+    case TRUE:
+    case FALSE:
+    case NULL:
+    case DECIMAL_LITERAL:
+    case HEX_LITERAL:
+    case OCTAL_LITERAL:
+    case FLOATING_POINT_LITERAL:
+    case STRING_LITERAL:
+      left = literal();
+      break;
+    case ID:
+    case QUOTED_ID:
+      left = variable();
+      break;
+    case 35:
+      jj_consume_token(35);
+      left = orExpression();
+      jj_consume_token(37);
+      break;
+    default:
+      jj_consume_token(-1);
+      throw new ParseException();
+    }
+        {if (true) return left;}
+    throw new Error("Missing return statement in function");
+  }
+
+  final public ConstantExpression literal() throws ParseException {
+    Token t;
+    String s;
+    ConstantExpression left=null;
+    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+    case STRING_LITERAL:
+      s = stringLiteral();
+                left = new ConstantExpression(s);
+      break;
+    case DECIMAL_LITERAL:
+      t = jj_consume_token(DECIMAL_LITERAL);
+                left = ConstantExpression.createFromDecimal(t.image);
+      break;
+    case HEX_LITERAL:
+      t = jj_consume_token(HEX_LITERAL);
+                left = ConstantExpression.createFromHex(t.image);
+      break;
+    case OCTAL_LITERAL:
+      t = jj_consume_token(OCTAL_LITERAL);
+                left = ConstantExpression.createFromOctal(t.image);
+      break;
+    case FLOATING_POINT_LITERAL:
+      t = jj_consume_token(FLOATING_POINT_LITERAL);
+                left = ConstantExpression.createFloat(t.image);
+      break;
+    case TRUE:
+      jj_consume_token(TRUE);
+                left = ConstantExpression.TRUE;
+      break;
+    case FALSE:
+      jj_consume_token(FALSE);
+                left = ConstantExpression.FALSE;
+      break;
+    case NULL:
+      jj_consume_token(NULL);
+                left = ConstantExpression.NULL;
+      break;
+    default:
+      jj_consume_token(-1);
+      throw new ParseException();
+    }
+        {if (true) return left;}
+    throw new Error("Missing return statement in function");
+  }
+
+  final public String stringLiteral() throws ParseException {
+    Token t;
+    StringBuffer rc = new StringBuffer();
+    boolean first=true;
+    t = jj_consume_token(STRING_LITERAL);
+        // Decode the sting value.
+        String image = t.image;
+        for( int i=1; i < image.length()-1; i++ ) {
+            char c = image.charAt(i);
+            if( c == (char) 0x27 )//single quote
+            {
+                i++;
+            }
+            rc.append(c);
+        }
+            {if (true) return rc.toString();}
+    throw new Error("Missing return statement in function");
+  }
+
+  final public ConfiguredObjectExpression variable() throws ParseException {
+    String s;
+    Token t;
+    ConfiguredObjectExpression right;
+    if (jj_2_7(2)) {
+      s = identifier();
+      jj_consume_token(43);
+      right = variable();
+        {if (true) return _factory.createConfiguredObjectExpression( s, right );}
+    } else if (jj_2_8(2)) {
+      s = identifier();
+      jj_consume_token(44);
+      t = jj_consume_token(DECIMAL_LITERAL);
+      jj_consume_token(45);
+        {if (true) return _factory.createConfiguredObjectExpression( s, Integer.valueOf( t.image ) );}
+    } else {
+      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+      case ID:
+      case QUOTED_ID:
+        s = identifier();
+        {if (true) return _factory.createConfiguredObjectExpression( s );}
+        break;
+      default:
+        jj_consume_token(-1);
+        throw new ParseException();
+      }
+    }
+    throw new Error("Missing return statement in function");
+  }
+
+  final public Expression functionExpression() throws ParseException {
+    String s;
+    Token t;
+    List<Expression> args = new ArrayList<Expression>();
+    Expression expr;
+    t = jj_consume_token(FUNCTIONNAME);
+    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+    case TRUE:
+    case FALSE:
+    case NULL:
+    case DECIMAL_LITERAL:
+    case HEX_LITERAL:
+    case OCTAL_LITERAL:
+    case FLOATING_POINT_LITERAL:
+    case STRING_LITERAL:
+    case FUNCTIONNAME:
+    case ID:
+    case QUOTED_ID:
+    case 35:
+      expr = primaryExpr();
+                                                    args.add(expr);
+      label_9:
+      while (true) {
+        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+        case 36:
+          ;
+          break;
+        default:
+          break label_9;
+        }
+        jj_consume_token(36);
+        expr = primaryExpr();
+                                                                                                   args.add(expr);
+      }
+      break;
+    default:
+      ;
+    }
+    jj_consume_token(37);
+        {if (true) return _factory.createFunctionExpression( t.image.substring(0, t.image.length() - 1), args );}
+    throw new Error("Missing return statement in function");
+  }
+
+  final public String identifier() throws ParseException {
+    Token t;
+    StringBuffer rc = new StringBuffer();
+    String s;
+    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+    case ID:
+      t = jj_consume_token(ID);
+            s = t.image;
+      break;
+    case QUOTED_ID:
+      t = jj_consume_token(QUOTED_ID);
+            // Decode the sting value.
+            String image = t.image;
+            for( int i=1; i < image.length()-1; i++ ) {
+                char c = image.charAt(i);
+                if( c == '"' )
+                {
+                    i++;
+                }
+                rc.append(c);
+            }
+            s = rc.toString();
+      break;
+    default:
+      jj_consume_token(-1);
+      throw new ParseException();
+    }
+        {if (true) return s;}
+    throw new Error("Missing return statement in function");
+  }
+
+  final public List<Map<String, Expression>> selectClause() throws ParseException {
+    List<Map<String, Expression>> returnVal = new ArrayList<Map<String, Expression>>();
+    Map<String, Expression> element;
+    element = selectClauseElement();
+                                        returnVal.add( element );
+    label_10:
+    while (true) {
+      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+      case 36:
+        ;
+        break;
+      default:
+        break label_10;
+      }
+      jj_consume_token(36);
+      element = selectClauseElement();
+                                              returnVal.add( element );
+    }
+        {if (true) return returnVal;}
+    throw new Error("Missing return statement in function");
+  }
+
+  final public Map<String, Expression> selectClauseElement() throws ParseException {
+    String name = null;
+    Expression expr;
+    expr = primaryExpr();
+    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+    case AS:
+      jj_consume_token(AS);
+      name = identifier();
+      break;
+    default:
+      ;
+    }
+          if(name == null)
+          {
+              name = ( expr instanceof NamedExpression ) ?  ((NamedExpression) expr).getName() : "";
+          }
+          {if (true) return Collections.singletonMap( name, expr );}
+    throw new Error("Missing return statement in function");
+  }
+
+  private boolean jj_2_1(int xla) {
+    jj_la = xla; jj_lastpos = jj_scanpos = token;
+    try { return !jj_3_1(); }
+    catch(LookaheadSuccess ls) { return true; }
+  }
+
+  private boolean jj_2_2(int xla) {
+    jj_la = xla; jj_lastpos = jj_scanpos = token;
+    try { return !jj_3_2(); }
+    catch(LookaheadSuccess ls) { return true; }
+  }
+
+  private boolean jj_2_3(int xla) {
+    jj_la = xla; jj_lastpos = jj_scanpos = token;
+    try { return !jj_3_3(); }
+    catch(LookaheadSuccess ls) { return true; }
+  }
+
+  private boolean jj_2_4(int xla) {
+    jj_la = xla; jj_lastpos = jj_scanpos = token;
+    try { return !jj_3_4(); }
+    catch(LookaheadSuccess ls) { return true; }
+  }
+
+  private boolean jj_2_5(int xla) {
+    jj_la = xla; jj_lastpos = jj_scanpos = token;
+    try { return !jj_3_5(); }
+    catch(LookaheadSuccess ls) { return true; }
+  }
+
+  private boolean jj_2_6(int xla) {
+    jj_la = xla; jj_lastpos = jj_scanpos = token;
+    try { return !jj_3_6(); }
+    catch(LookaheadSuccess ls) { return true; }
+  }
+
+  private boolean jj_2_7(int xla) {
+    jj_la = xla; jj_lastpos = jj_scanpos = token;
+    try { return !jj_3_7(); }
+    catch(LookaheadSuccess ls) { return true; }
+  }
+
+  private boolean jj_2_8(int xla) {
+    jj_la = xla; jj_lastpos = jj_scanpos = token;
+    try { return !jj_3_8(); }
+    catch(LookaheadSuccess ls) { return true; }
+  }
+
+  private boolean jj_3R_62() {
+    if (jj_scan_token(BETWEEN)) return true;
+    if (jj_3R_51()) return true;
+    if (jj_scan_token(AND)) return true;
+    if (jj_3R_51()) return true;
+    return false;
+  }
+
+  private boolean jj_3R_66() {
+    if (jj_scan_token(ESCAPE)) return true;
+    if (jj_3R_46()) return true;
+    return false;
+  }
+
+  private boolean jj_3R_38() {
+    if (jj_scan_token(FLOATING_POINT_LITERAL)) return true;
+    return false;
+  }
+
+  private boolean jj_3R_23() {
+    if (jj_scan_token(42)) return true;
+    if (jj_3R_12()) return true;
+    return false;
+  }
+
+  private boolean jj_3R_29() {
+    if (jj_scan_token(FUNCTIONNAME)) return true;
+    Token xsp;
+    xsp = jj_scanpos;
+    if (jj_3R_33()) jj_scanpos = xsp;
+    if (jj_scan_token(37)) return true;
+    return false;
+  }
+
+  private boolean jj_3R_47() {
+    if (jj_3R_49()) return true;
+    Token xsp;
+    while (true) {
+      xsp = jj_scanpos;
+      if (jj_3R_50()) { jj_scanpos = xsp; break; }
+    }
+    return false;
+  }
+
+  private boolean jj_3_2() {
+    if (jj_scan_token(NOT)) return true;
+    if (jj_scan_token(LIKE)) return true;
+    if (jj_3R_46()) return true;
+    Token xsp;
+    xsp = jj_scanpos;
+    if (jj_3R_67()) jj_scanpos = xsp;
+    return false;
+  }
+
+  private boolean jj_3R_61() {
+    if (jj_scan_token(LIKE)) return true;
+    if (jj_3R_46()) return true;
+    Token xsp;
+    xsp = jj_scanpos;
+    if (jj_3R_66()) jj_scanpos = xsp;
+    return false;
+  }
+
+  private boolean jj_3R_37() {
+    if (jj_scan_token(OCTAL_LITERAL)) return true;
+    return false;
+  }
+
+  private boolean jj_3R_22() {
+    if (jj_scan_token(41)) return true;
+    if (jj_3R_12()) return true;
+    return false;
+  }
+
+  private boolean jj_3R_14() {
+    Token xsp;
+    xsp = jj_scanpos;
+    if (jj_3R_21()) {
+    jj_scanpos = xsp;
+    if (jj_3R_22()) {
+    jj_scanpos = xsp;
+    if (jj_3R_23()) return true;
+    }
+    }
+    return false;
+  }
+
+  private boolean jj_3R_21() {
+    if (jj_scan_token(40)) return true;
+    if (jj_3R_12()) return true;
+    return false;
+  }
+
+  private boolean jj_3R_48() {
+    if (jj_scan_token(AND)) return true;
+    if (jj_3R_47()) return true;
+    return false;
+  }
+
+  private boolean jj_3R_36() {
+    if (jj_scan_token(HEX_LITERAL)) return true;
+    return false;
+  }
+
+  private boolean jj_3R_11() {
+    if (jj_3R_12()) return true;
+    Token xsp;
+    while (true) {
+      xsp = jj_scanpos;
+      if (jj_3R_14()) { jj_scanpos = xsp; break; }
+    }
+    return false;
+  }
+
+  private boolean jj_3R_42() {
+    if (jj_3R_13()) return true;
+    return false;
+  }
+
+  private boolean jj_3R_35() {
+    if (jj_scan_token(DECIMAL_LITERAL)) return true;
+    return false;
+  }
+
+  private boolean jj_3R_65() {
+    if (jj_scan_token(39)) return true;
+    if (jj_3R_11()) return true;
+    return false;
+  }
+
+  private boolean jj_3R_43() {
+    if (jj_3R_47()) return true;
+    Token xsp;
+    while (true) {
+      xsp = jj_scanpos;
+      if (jj_3R_48()) { jj_scanpos = xsp; break; }
+    }
+    return false;
+  }
+
+  private boolean jj_3_5() {
+    Token xsp;
+    xsp = jj_scanpos;
+    if (jj_scan_token(38)) {
+    jj_scanpos = xsp;
+    if (jj_scan_token(39)) return true;
+    }
+    if (jj_3R_11()) return true;
+    return false;
+  }
+
+  private boolean jj_3R_60() {
+    if (jj_scan_token(34)) return true;
+    if (jj_3R_51()) return true;
+    return false;
+  }
+
+  private boolean jj_3R_34() {
+    if (jj_3R_46()) return true;
+    return false;
+  }
+
+  private boolean jj_3_8() {
+    if (jj_3R_13()) return true;
+    if (jj_scan_token(44)) return true;
+    if (jj_scan_token(DECIMAL_LITERAL)) return true;
+    if (jj_scan_token(45)) return true;
+    return false;
+  }
+
+  private boolean jj_3R_45() {
+    if (jj_scan_token(36)) return true;
+    if (jj_3R_24()) return true;
+    return false;
+  }
+
+  private boolean jj_3R_64() {
+    if (jj_scan_token(38)) return true;
+    if (jj_3R_11()) return true;
+    return false;
+  }
+
+  private boolean jj_3R_59() {
+    if (jj_scan_token(33)) return true;
+    if (jj_3R_51()) return true;
+    return false;
+  }
+
+  private boolean jj_3R_30() {
+    Token xsp;
+    xsp = jj_scanpos;
+    if (jj_3R_34()) {
+    jj_scanpos = xsp;
+    if (jj_3R_35()) {
+    jj_scanpos = xsp;
+    if (jj_3R_36()) {
+    jj_scanpos = xsp;
+    if (jj_3R_37()) {
+    jj_scanpos = xsp;
+    if (jj_3R_38()) {
+    jj_scanpos = xsp;
+    if (jj_3R_39()) {
+    jj_scanpos = xsp;
+    if (jj_3R_40()) {
+    jj_scanpos = xsp;
+    if (jj_3R_41()) return true;
+    }
+    }
+    }
+    }
+    }
+    }
+    }
+    return false;
+  }
+
+  private boolean jj_3R_69() {
+    if (jj_scan_token(36)) return true;
+    if (jj_3R_24()) return true;
+    return false;
+  }
+
+  private boolean jj_3R_56() {
+    Token xsp;
+    xsp = jj_scanpos;
+    if (jj_3R_64()) {
+    jj_scanpos = xsp;
+    if (jj_3R_65()) return true;
+    }
+    return false;
+  }
+
+  private boolean jj_3R_44() {
+    if (jj_scan_token(OR)) return true;
+    if (jj_3R_43()) return true;
+    return false;
+  }
+
+  private boolean jj_3_7() {
+    if (jj_3R_13()) return true;
+    if (jj_scan_token(43)) return true;
+    if (jj_3R_31()) return true;
+    return false;
+  }
+
+  private boolean jj_3R_31() {
+    Token xsp;
+    xsp = jj_scanpos;
+    if (jj_3_7()) {
+    jj_scanpos = xsp;
+    if (jj_3_8()) {
+    jj_scanpos = xsp;
+    if (jj_3R_42()) return true;
+    }
+    }
+    return false;
+  }
+
+  private boolean jj_3R_58() {
+    if (jj_scan_token(32)) return true;
+    if (jj_3R_51()) return true;
+    return false;
+  }
+
+  private boolean jj_3R_57() {
+    if (jj_scan_token(31)) return true;
+    if (jj_3R_51()) return true;
+    return false;
+  }
+
+  private boolean jj_3R_52() {
+    Token xsp;
+    xsp = jj_scanpos;
+    if (jj_3R_57()) {
+    jj_scanpos = xsp;
+    if (jj_3R_58()) {
+    jj_scanpos = xsp;
+    if (jj_3R_59()) {
+    jj_scanpos = xsp;
+    if (jj_3R_60()) {
+    jj_scanpos = xsp;
+    if (jj_3R_61()) {
+    jj_scanpos = xsp;
+    if (jj_3_2()) {
+    jj_scanpos = xsp;
+    if (jj_3R_62()) {
+    jj_scanpos = xsp;
+    if (jj_3_3()) {
+    jj_scanpos = xsp;
+    if (jj_3R_63()) {
+    jj_scanpos = xsp;
+    if (jj_3_4()) return true;
+    }
+    }
+    }
+    }
+    }
+    }
+    }
+    }
+    }
+    return false;
+  }
+
+  private boolean jj_3R_51() {
+    if (jj_3R_11()) return true;
+    Token xsp;
+    while (true) {
+      xsp = jj_scanpos;
+      if (jj_3R_56()) { jj_scanpos = xsp; break; }
+    }
+    return false;
+  }
+
+  private boolean jj_3R_28() {
+    if (jj_scan_token(35)) return true;
+    if (jj_3R_32()) return true;
+    if (jj_scan_token(37)) return true;
+    return false;
+  }
+
+  private boolean jj_3R_32() {
+    if (jj_3R_43()) return true;
+    Token xsp;
+    while (true) {
+      xsp = jj_scanpos;
+      if (jj_3R_44()) { jj_scanpos = xsp; break; }
+    }
+    return false;
+  }
+
+  private boolean jj_3R_27() {
+    if (jj_3R_31()) return true;
+    return false;
+  }
+
+  private boolean jj_3R_26() {
+    if (jj_3R_30()) return true;
+    return false;
+  }
+
+  private boolean jj_3R_25() {
+    if (jj_3R_29()) return true;
+    return false;
+  }
+
+  private boolean jj_3R_68() {
+    if (jj_scan_token(36)) return true;
+    if (jj_3R_24()) return true;
+    return false;
+  }
+
+  private boolean jj_3R_24() {
+    Token xsp;
+    xsp = jj_scanpos;
+    if (jj_3R_25()) {
+    jj_scanpos = xsp;
+    if (jj_3R_26()) {
+    jj_scanpos = xsp;
+    if (jj_3R_27()) {
+    jj_scanpos = xsp;
+    if (jj_3R_28()) return true;
+    }
+    }
+    }
+    return false;
+  }
+
+  private boolean jj_3R_49() {
+    if (jj_3R_51()) return true;
+    Token xsp;
+    while (true) {
+      xsp = jj_scanpos;
+      if (jj_3R_52()) { jj_scanpos = xsp; break; }
+    }
+    return false;
+  }
+
+  private boolean jj_3R_46() {
+    if (jj_scan_token(STRING_LITERAL)) return true;
+    return false;
+  }
+
+  private boolean jj_3_4() {
+    if (jj_scan_token(NOT)) return true;
+    if (jj_scan_token(IN)) return true;
+    if (jj_scan_token(35)) return true;
+    if (jj_3R_24()) return true;
+    Token xsp;
+    while (true) {
+      xsp = jj_scanpos;
+      if (jj_3R_69()) { jj_scanpos = xsp; break; }
+    }
+    if (jj_scan_token(37)) return true;
+    return false;
+  }
+
+  private boolean jj_3_6() {
+    if (jj_scan_token(38)) return true;
+    if (jj_3R_12()) return true;
+    return false;
+  }
+
+  private boolean jj_3R_67() {
+    if (jj_scan_token(ESCAPE)) return true;
+    if (jj_3R_46()) return true;
+    return false;
+  }
+
+  private boolean jj_3R_18() {
+    if (jj_3R_24()) return true;
+    return false;
+  }
+
+  private boolean jj_3R_17() {
+    if (jj_scan_token(NOT)) return true;
+    if (jj_3R_12()) return true;
+    return false;
+  }
+
+  private boolean jj_3R_15() {
+    if (jj_scan_token(38)) return true;
+    if (jj_3R_12()) return true;
+    return false;
+  }
+
+  private boolean jj_3R_63() {
+    if (jj_scan_token(IN)) return true;
+    if (jj_scan_token(35)) return true;
+    if (jj_3R_24()) return true;
+    Token xsp;
+    while (true) {
+      xsp = jj_scanpos;
+      if (jj_3R_68()) { jj_scanpos = xsp; break; }
+    }
+    if (jj_scan_token(37)) return true;
+    return false;
+  }
+
+  private boolean jj_3R_55() {
+    if (jj_scan_token(IS)) return true;
+    if (jj_scan_token(NOT)) return true;
+    if (jj_scan_token(NULL)) return true;
+    return false;
+  }
+
+  private boolean jj_3R_16() {
+    if (jj_scan_token(39)) return true;
+    if (jj_3R_12()) return true;
+    return false;
+  }
+
+  private boolean jj_3R_33() {
+    if (jj_3R_24()) return true;
+    Token xsp;
+    while (true) {
+      xsp = jj_scanpos;
+      if (jj_3R_45()) { jj_scanpos = xsp; break; }
+    }
+    return false;
+  }
+
+  private boolean jj_3R_20() {
+    if (jj_scan_token(QUOTED_ID)) return true;
+    return false;
+  }
+
+  private boolean jj_3R_41() {
+    if (jj_scan_token(NULL)) return true;
+    return false;
+  }
+
+  private boolean jj_3_1() {
+    if (jj_scan_token(IS)) return true;
+    if (jj_scan_token(NULL)) return true;
+    return false;
+  }
+
+  private boolean jj_3R_19() {
+    if (jj_scan_token(ID)) return true;
+    return false;
+  }
+
+  private boolean jj_3R_12() {
+    Token xsp;
+    xsp = jj_scanpos;
+    if (jj_3R_15()) {
+    jj_scanpos = xsp;
+    if (jj_3R_16()) {
+    jj_scanpos = xsp;
+    if (jj_3R_17()) {
+    jj_scanpos = xsp;
+    if (jj_3R_18()) return true;
+    }
+    }
+    }
+    return false;
+  }
+
+  private boolean jj_3R_40() {
+    if (jj_scan_token(FALSE)) return true;
+    return false;
+  }
+
+  private boolean jj_3R_54() {
+    if (jj_scan_token(30)) return true;
+    if (jj_3R_49()) return true;
+    return false;
+  }
+
+  private boolean jj_3R_13() {
+    Token xsp;
+    xsp = jj_scanpos;
+    if (jj_3R_19()) {
+    jj_scanpos = xsp;
+    if (jj_3R_20()) return true;
+    }
+    return false;
+  }
+
+  private boolean jj_3_3() {
+    if (jj_scan_token(NOT)) return true;
+    if (jj_scan_token(BETWEEN)) return true;
+    if (jj_3R_51()) return true;
+    if (jj_scan_token(AND)) return true;
+    if (jj_3R_51()) return true;
+    return false;
+  }
+
+  private boolean jj_3R_53() {
+    if (jj_scan_token(29)) return true;
+    if (jj_3R_49()) return true;
+    return false;
+  }
+
+  private boolean jj_3R_50() {
+    Token xsp;
+    xsp = jj_scanpos;
+    if (jj_3R_53()) {
+    jj_scanpos = xsp;
+    if (jj_3R_54()) {
+    jj_scanpos = xsp;
+    if (jj_3_1()) {
+    jj_scanpos = xsp;
+    if (jj_3R_55()) return true;
+    }
+    }
+    }
+    return false;
+  }
+
+  private boolean jj_3R_39() {
+    if (jj_scan_token(TRUE)) return true;
+    return false;
+  }
+
+  /** Generated Token Manager. */
+  public ConfiguredObjectFilterParserTokenManager token_source;
+  SimpleCharStream jj_input_stream;
+  /** Current token. */
+  public Token token;
+  /** Next token. */
+  public Token jj_nt;
+  private int jj_ntk;
+  private Token jj_scanpos, jj_lastpos;
+  private int jj_la;
+
+  /** Constructor with InputStream. */
+  public ConfiguredObjectFilterParser(java.io.InputStream stream) {
+     this(stream, null);
+  }
+  /** Constructor with InputStream and supplied encoding */
+  public ConfiguredObjectFilterParser(java.io.InputStream stream, String encoding) {
+    try { jj_input_stream = new SimpleCharStream(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); }
+    token_source = new ConfiguredObjectFilterParserTokenManager(jj_input_stream);
+    token = new Token();
+    jj_ntk = -1;
+  }
+
+  /** Reinitialise. */
+  public void ReInit(java.io.InputStream stream) {
+     ReInit(stream, null);
+  }
+  /** Reinitialise. */
+  public void ReInit(java.io.InputStream stream, String encoding) {
+    try { jj_input_stream.ReInit(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); }
+    token_source.ReInit(jj_input_stream);
+    token = new Token();
+    jj_ntk = -1;
+  }
+
+  /** Constructor. */
+  public ConfiguredObjectFilterParser(java.io.Reader stream) {
+    jj_input_stream = new SimpleCharStream(stream, 1, 1);
+    token_source = new ConfiguredObjectFilterParserTokenManager(jj_input_stream);
+    token = new Token();
+    jj_ntk = -1;
+  }
+
+  /** Reinitialise. */
+  public void ReInit(java.io.Reader stream) {
+    jj_input_stream.ReInit(stream, 1, 1);
+    token_source.ReInit(jj_input_stream);
+    token = new Token();
+    jj_ntk = -1;
+  }
+
+  /** Constructor with generated Token Manager. */
+  public ConfiguredObjectFilterParser(ConfiguredObjectFilterParserTokenManager tm) {
+    token_source = tm;
+    token = new Token();
+    jj_ntk = -1;
+  }
+
+  /** Reinitialise. */
+  public void ReInit(ConfiguredObjectFilterParserTokenManager tm) {
+    token_source = tm;
+    token = new Token();
+    jj_ntk = -1;
+  }
+
+  private Token jj_consume_token(int kind) throws ParseException {
+    Token oldToken;
+    if ((oldToken = token).next != null) token = token.next;
+    else token = token.next = token_source.getNextToken();
+    jj_ntk = -1;
+    if (token.kind == kind) {
+      return token;
+    }
+    token = oldToken;
+    throw generateParseException();
+  }
+
+  static private final class LookaheadSuccess extends java.lang.Error { }
+  final private LookaheadSuccess jj_ls = new LookaheadSuccess();
+  private boolean jj_scan_token(int kind) {
+    if (jj_scanpos == jj_lastpos) {
+      jj_la--;
+      if (jj_scanpos.next == null) {
+        jj_lastpos = jj_scanpos = jj_scanpos.next = token_source.getNextToken();
+      } else {
+        jj_lastpos = jj_scanpos = jj_scanpos.next;
+      }
+    } else {
+      jj_scanpos = jj_scanpos.next;
+    }
+    if (jj_scanpos.kind != kind) return true;
+    if (jj_la == 0 && jj_scanpos == jj_lastpos) throw jj_ls;
+    return false;
+  }
+
+
+/** Get the next Token. */
+  final public Token getNextToken() {
+    if (token.next != null) token = token.next;
+    else token = token.next = token_source.getNextToken();
+    jj_ntk = -1;
+    return token;
+  }
+
+/** Get the specific Token. */
+  final public Token getToken(int index) {
+    Token t = token;
+    for (int i = 0; i < index; i++) {
+      if (t.next != null) t = t.next;
+      else t = t.next = token_source.getNextToken();
+    }
+    return t;
+  }
+
+  private int jj_ntk() {
+    if ((jj_nt=token.next) == null)
+      return (jj_ntk = (token.next=token_source.getNextToken()).kind);
+    else
+      return (jj_ntk = jj_nt.kind);
+  }
+
+  /** Generate ParseException. */
+  public ParseException generateParseException() {
+    Token errortok = token.next;
+    int line = errortok.beginLine, column = errortok.beginColumn;
+    String mess = (errortok.kind == 0) ? tokenImage[0] : errortok.image;
+    return new ParseException("Parse error at line " + line + ", column " + column + ".  Encountered: " + mess);
+  }
+
+  /** Enable tracing. */
+  final public void enable_tracing() {
+  }
+
+  /** Disable tracing. */
+  final public void disable_tracing() {
+  }
+
+}

Propchange: qpid/java/trunk/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/query/ConfiguredObjectFilterParser.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: qpid/java/trunk/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/query/ConfiguredObjectFilterParserConstants.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/query/ConfiguredObjectFilterParserConstants.java?rev=1722953&view=auto
==============================================================================
--- qpid/java/trunk/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/query/ConfiguredObjectFilterParserConstants.java (added)
+++ qpid/java/trunk/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/query/ConfiguredObjectFilterParserConstants.java Mon Jan  4 19:55:44 2016
@@ -0,0 +1,134 @@
+/* Generated By:JavaCC: Do not edit this line. ConfiguredObjectFilterParserConstants.java */
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.qpid.server.management.plugin.servlet.query;
+
+
+/**
+ * Token literal values and constants.
+ * Generated by org.javacc.parser.OtherFilesGen#start()
+ */
+public interface ConfiguredObjectFilterParserConstants {
+
+  /** End of File. */
+  int EOF = 0;
+  /** RegularExpression Id. */
+  int LINE_COMMENT = 6;
+  /** RegularExpression Id. */
+  int BLOCK_COMMENT = 7;
+  /** RegularExpression Id. */
+  int NOT = 8;
+  /** RegularExpression Id. */
+  int AND = 9;
+  /** RegularExpression Id. */
+  int OR = 10;
+  /** RegularExpression Id. */
+  int BETWEEN = 11;
+  /** RegularExpression Id. */
+  int LIKE = 12;
+  /** RegularExpression Id. */
+  int ESCAPE = 13;
+  /** RegularExpression Id. */
+  int IN = 14;
+  /** RegularExpression Id. */
+  int IS = 15;
+  /** RegularExpression Id. */
+  int TRUE = 16;
+  /** RegularExpression Id. */
+  int FALSE = 17;
+  /** RegularExpression Id. */
+  int NULL = 18;
+  /** RegularExpression Id. */
+  int AS = 19;
+  /** RegularExpression Id. */
+  int DECIMAL_LITERAL = 20;
+  /** RegularExpression Id. */
+  int HEX_LITERAL = 21;
+  /** RegularExpression Id. */
+  int OCTAL_LITERAL = 22;
+  /** RegularExpression Id. */
+  int FLOATING_POINT_LITERAL = 23;
+  /** RegularExpression Id. */
+  int EXPONENT = 24;
+  /** RegularExpression Id. */
+  int STRING_LITERAL = 25;
+  /** RegularExpression Id. */
+  int FUNCTIONNAME = 26;
+  /** RegularExpression Id. */
+  int ID = 27;
+  /** RegularExpression Id. */
+  int QUOTED_ID = 28;
+
+  /** Lexical state. */
+  int DEFAULT = 0;
+
+  /** Literal token values. */
+  String[] tokenImage = {
+    "<EOF>",
+    "\" \"",
+    "\"\\t\"",
+    "\"\\n\"",
+    "\"\\r\"",
+    "\"\\f\"",
+    "<LINE_COMMENT>",
+    "<BLOCK_COMMENT>",
+    "\"NOT\"",
+    "\"AND\"",
+    "\"OR\"",
+    "\"BETWEEN\"",
+    "\"LIKE\"",
+    "\"ESCAPE\"",
+    "\"IN\"",
+    "\"IS\"",
+    "\"TRUE\"",
+    "\"FALSE\"",
+    "\"NULL\"",
+    "\"AS\"",
+    "<DECIMAL_LITERAL>",
+    "<HEX_LITERAL>",
+    "<OCTAL_LITERAL>",
+    "<FLOATING_POINT_LITERAL>",
+    "<EXPONENT>",
+    "<STRING_LITERAL>",
+    "<FUNCTIONNAME>",
+    "<ID>",
+    "<QUOTED_ID>",
+    "\"=\"",
+    "\"<>\"",
+    "\">\"",
+    "\">=\"",
+    "\"<\"",
+    "\"<=\"",
+    "\"(\"",
+    "\",\"",
+    "\")\"",
+    "\"+\"",
+    "\"-\"",
+    "\"*\"",
+    "\"/\"",
+    "\"%\"",
+    "\".\"",
+    "\"[\"",
+    "\"]\"",
+  };
+
+}

Propchange: qpid/java/trunk/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/query/ConfiguredObjectFilterParserConstants.java
------------------------------------------------------------------------------
    svn:eol-style = native



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message