Return-Path: Delivered-To: apmail-geronimo-activemq-commits-archive@www.apache.org Received: (qmail 61903 invoked from network); 5 Jan 2006 10:04:25 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 5 Jan 2006 10:04:25 -0000 Received: (qmail 11059 invoked by uid 500); 5 Jan 2006 10:04:24 -0000 Delivered-To: apmail-geronimo-activemq-commits-archive@geronimo.apache.org Received: (qmail 11036 invoked by uid 500); 5 Jan 2006 10:04:24 -0000 Mailing-List: contact activemq-commits-help@geronimo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: activemq-dev@geronimo.apache.org Delivered-To: mailing list activemq-commits@geronimo.apache.org Received: (qmail 11027 invoked by uid 99); 5 Jan 2006 10:04:24 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Jan 2006 02:04:24 -0800 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.29) with SMTP; Thu, 05 Jan 2006 02:04:23 -0800 Received: (qmail 61809 invoked by uid 65534); 5 Jan 2006 10:04:13 -0000 Message-ID: <20060105100413.61808.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r366145 - /incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/Main.java Date: Thu, 05 Jan 2006 10:04:12 -0000 To: activemq-commits@geronimo.apache.org From: aco@apache.org X-Mailer: svnmailer-1.0.5 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: aco Date: Thu Jan 5 02:04:04 2006 New Revision: 366145 URL: http://svn.apache.org/viewcvs?rev=366145&view=rev Log: Change subtractive query to use -xQ and --xobjname instead of !. Having trouble using ! in linux. Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/Main.java Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/Main.java URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/Main.java?rev=366145&r1=366144&r2=366145&view=diff ============================================================================== --- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/Main.java (original) +++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/Main.java Thu Jan 5 02:04:04 2006 @@ -272,7 +272,7 @@ System.setProperty(key, value); } - // If token is a predefined query define option + // If token is a additive predefined query define option else if (token.startsWith("-Q")) { String key = token.substring(2); String value = ""; @@ -282,32 +282,37 @@ key = key.substring(0, pos); } - // If subtractive query - if (key.startsWith("!")) { - // Transform predefined query to object name query - String predefQuery = PREDEFINED_OBJNAME_QUERY.getProperty(key.substring(1)); - if (predefQuery == null) { - printError("Unknown query object type: " + key.substring(1)); - return; - } - String queryStr = createQueryString(predefQuery, value); - querySubObjects.add(queryStr); + // If additive query + String predefQuery = PREDEFINED_OBJNAME_QUERY.getProperty(key); + if (predefQuery == null) { + printError("Unknown query object type: " + key); + return; } + String queryStr = createQueryString(predefQuery, value); + queryAddObjects.add(queryStr); + } - // If additive query - else { - // Transform predefined query to object name query - String predefQuery = PREDEFINED_OBJNAME_QUERY.getProperty(key); - if (predefQuery == null) { - printError("Unknown query object type: " + key); - return; - } - String queryStr = createQueryString(predefQuery, value); - queryAddObjects.add(queryStr); + // If token is a substractive predefined query define option + else if (token.startsWith("-xQ")) { + String key = token.substring(3); + String value = ""; + int pos = key.indexOf("="); + if (pos >= 0) { + value = key.substring(pos + 1); + key = key.substring(0, pos); } + + // If subtractive query + String predefQuery = PREDEFINED_OBJNAME_QUERY.getProperty(key); + if (predefQuery == null) { + printError("Unknown query object type: " + key); + return; + } + String queryStr = createQueryString(predefQuery, value); + querySubObjects.add(queryStr); } - // If token is an object name query option + // If token is an additive object name query option else if (token.startsWith("--objname")) { // If no object name query is specified, or next token is a new option @@ -317,15 +322,20 @@ } String queryString = (String)tokens.remove(0); + queryAddObjects.add(queryString); + } - // If subtractive query - if (queryString.startsWith("!")) { - querySubObjects.add(queryString.substring(1)); + // If token is a substractive object name query option + else if (token.startsWith("--xobjname")) { - // If additive query - } else { - queryAddObjects.add(queryString); + // If no object name query is specified, or next token is a new option + if (tokens.isEmpty() || ((String)tokens.get(0)).startsWith("-")) { + printError("Object name query not specified"); + return; } + + String queryString = (String)tokens.remove(0); + querySubObjects.add(queryString); } // If token is a view option @@ -1140,9 +1150,9 @@ "", "Query Options:", " -Q= Add to the search list the specific object type matched by the defined object identifier.", - " -Q!= Remove from the search list the specific object type matched by the object identifier.", + " -xQ= Remove from the search list the specific object type matched by the object identifier.", " --objname Add to the search list objects matched by the query similar to the JMX object name format.", - " --objname ! Remove from the search list objects matched by the query similar to the JMX object name format.", + " --xobjname Remove from the search list objects matched by the query similar to the JMX object name format.", " --view ,,... Select the specific attribute of the object to view. By default all attributes will be displayed.", " --jmxurl Set the JMX URL to connect to.", " --version Display the version information.", @@ -1167,13 +1177,13 @@ " Main -QTopic=* -QQueue=* --view EnqueueCount,DequeueCount", " - Print the attributes EnqueueCount and DequeueCount of all registered topics and queues.", "", - " Main -QTopic=* -Q!Topic=ActiveMQ.Advisory.*", + " Main -QTopic=* -xQTopic=ActiveMQ.Advisory.*", " - Print all attributes of all topics except those that has a name that begins with \"ActiveMQ.Advisory\".", "", - " Main --objname Type=*Connect*,BrokerName=local* -Q!NetworkConnector=*", + " Main --objname Type=*Connect*,BrokerName=local* -xQNetworkConnector=*", " - Print all attributes of all connectors, connections excluding network connectors that belongs to the broker that begins with local.", "", - " Main -QQueue=* -Q!Queue=????", + " Main -QQueue=* -xQQueue=????", " - Print all attributes of all queues except those that are 4 letters long.", "", }