diff --git a/rpms/awips2.qpid/0.18/SOURCES/awips.patch b/rpms/awips2.qpid/0.18/SOURCES/awips.patch deleted file mode 100644 index a678d65890..0000000000 --- a/rpms/awips2.qpid/0.18/SOURCES/awips.patch +++ /dev/null @@ -1,192 +0,0 @@ -diff -crB a/qpid/java/broker/bin/qpid-passwd b/qpid/java/broker/bin/qpid-passwd -*** a/qpid/java/broker/bin/qpid-passwd 2012-02-15 09:29:22.000000000 -0600 ---- b/qpid/java/broker/bin/qpid-passwd 2013-07-30 16:23:13.000000000 -0500 -*************** -*** 24,30 **** - fi - - # Set classpath to include Qpid jar with all required jars in manifest -! QPID_LIBS=$QPID_HOME/lib/qpid-all.jar - - # Set other variables used by the qpid-run script before calling - export JAVA=java \ ---- 24,30 ---- - fi - - # Set classpath to include Qpid jar with all required jars in manifest -! QPID_LIBS="$QPID_HOME/lib/qpid-all.jar:$QPID_HOME/lib/opt/*:$QPID_HOME/lib/opt/qpid-deps/*" - - # Set other variables used by the qpid-run script before calling - export JAVA=java \ -diff -crB a/qpid/java/broker/bin/qpid-server b/qpid/java/broker/bin/qpid-server -*** a/qpid/java/broker/bin/qpid-server 2011-09-30 08:38:14.000000000 -0500 ---- b/qpid/java/broker/bin/qpid-server 2013-07-30 16:23:13.000000000 -0500 -*************** -*** 23,30 **** - fi - - if [ -z "$QPID_WORK" ]; then -! echo "Setting QPID_WORK to $HOME as default" -! QPID_WORK=$HOME - fi - - # Set to help us get round the manifold problems of ps/pgrep on various ---- 23,29 ---- - fi - - if [ -z "$QPID_WORK" ]; then -! export QPID_WORK=$QPID_HOME - fi - - # Set to help us get round the manifold problems of ps/pgrep on various -*************** -*** 34,43 **** - fi - - # Set classpath to include the qpid-all manifest jar, and any jars supplied in lib/opt -! QPID_LIBS="$QPID_HOME/lib/qpid-all.jar:$QPID_HOME/lib/opt/*" - - # Set other variables used by the qpid-run script before calling -! export JAVA=java \ - JAVA_VM=-server \ - JAVA_MEM=-Xmx1024m \ - JAVA_GC="-XX:+UseConcMarkSweepGC -XX:+HeapDumpOnOutOfMemoryError" \ ---- 33,42 ---- - fi - - # Set classpath to include the qpid-all manifest jar, and any jars supplied in lib/opt -! QPID_LIBS="$QPID_HOME/lib/qpid-all.jar:$QPID_HOME/lib/opt/*:$QPID_HOME/lib/opt/qpid-deps/*" - - # Set other variables used by the qpid-run script before calling -! export JAVA=/awips2/java/bin/java \ - JAVA_VM=-server \ - JAVA_MEM=-Xmx1024m \ - JAVA_GC="-XX:+UseConcMarkSweepGC -XX:+HeapDumpOnOutOfMemoryError" \ -Only in b/qpid/java/broker/bin: qpid-server.orig -diff -crB a/qpid/java/build.deps b/qpid/java/build.deps -*** a/qpid/java/build.deps 2012-07-08 10:28:32.000000000 -0500 ---- b/qpid/java/build.deps 2013-07-30 16:23:13.000000000 -0500 -*************** -*** 17,29 **** - # under the License. - # - -! commons-beanutils-core=lib/required/commons-beanutils-core-1.8.3.jar - commons-cli=lib/required/commons-cli-1.2.jar -! commons-codec=lib/required/commons-codec-1.6.jar - commons-collections=lib/required/commons-collections-3.2.1.jar - commons-configuration=lib/required/commons-configuration-1.8.jar - commons-digester=lib/required/commons-digester-1.8.1.jar -! commons-lang=lib/required/commons-lang-2.6.jar - commons-logging=lib/required/commons-logging-1.1.1.jar - - derby-db=lib/required/derby-10.8.2.2.jar ---- 17,29 ---- - # under the License. - # - -! commons-beanutils-core=lib/required/commons-beanutils-1.8.3.jar - commons-cli=lib/required/commons-cli-1.2.jar -! commons-codec=lib/required/commons-codec-1.4.jar - commons-collections=lib/required/commons-collections-3.2.1.jar - commons-configuration=lib/required/commons-configuration-1.8.jar - commons-digester=lib/required/commons-digester-1.8.1.jar -! commons-lang=lib/required/commons-lang-2.3.jar - commons-logging=lib/required/commons-logging-1.1.1.jar - - derby-db=lib/required/derby-10.8.2.2.jar -*************** -*** 33,39 **** - geronimo-jta=lib/required/geronimo-jta_1.1_spec-1.1.1.jar - geronimo-kernel=lib/required/geronimo-kernel-2.2.1.jar - geronimo-openejb=lib/required/geronimo-ejb_3.0_spec-1.0.1.jar -! geronimo-servlet=lib/required/geronimo-servlet_2.5_spec-1.2.jar - - junit=lib/required/junit-3.8.1.jar - mockito-all=lib/required/mockito-all-1.9.0.jar ---- 33,39 ---- - geronimo-jta=lib/required/geronimo-jta_1.1_spec-1.1.1.jar - geronimo-kernel=lib/required/geronimo-kernel-2.2.1.jar - geronimo-openejb=lib/required/geronimo-ejb_3.0_spec-1.0.1.jar -! geronimo-servlet=lib/required/geronimo-servlet_2.5_spec-1.1.2.jar - - junit=lib/required/junit-3.8.1.jar - mockito-all=lib/required/mockito-all-1.9.0.jar -*************** -*** 45,51 **** - slf4j-api=lib/required/slf4j-api-1.6.4.jar - slf4j-log4j=lib/required/slf4j-log4j12-1.6.4.jar - -! xalan=lib/required/xalan-2.7.0.jar - - jetty=lib/required/jetty-server-7.6.3.v20120416.jar - jetty-continuation=lib/required/jetty-continuation-7.6.3.v20120416.jar ---- 45,51 ---- - slf4j-api=lib/required/slf4j-api-1.6.4.jar - slf4j-log4j=lib/required/slf4j-log4j12-1.6.4.jar - -! xalan=lib/required/xalan-2.7.1.jar - - jetty=lib/required/jetty-server-7.6.3.v20120416.jar - jetty-continuation=lib/required/jetty-continuation-7.6.3.v20120416.jar -*************** -*** 63,70 **** - - felix.libs=${felix-main} - -! jackson-core=lib/required/jackson-core-asl-1.9.0.jar -! jackson-mapper=lib/required/jackson-mapper-asl-1.9.0.jar - - commons-configuration.libs = ${commons-beanutils-core} ${commons-digester} \ - ${commons-codec} ${commons-lang} ${commons-collections} ${commons-configuration} ---- 63,70 ---- - - felix.libs=${felix-main} - -! jackson-core=lib/required/jackson-core-asl-1.7.3.jar -! jackson-mapper=lib/required/jackson-mapper-asl-1.7.3.jar - - commons-configuration.libs = ${commons-beanutils-core} ${commons-digester} \ - ${commons-codec} ${commons-lang} ${commons-collections} ${commons-configuration} -Only in b/qpid/java: build.deps.orig -diff -crB a/qpid/java/common/bin/qpid-jaddr b/qpid/java/common/bin/qpid-jaddr -*** a/qpid/java/common/bin/qpid-jaddr 2010-06-07 15:13:47.000000000 -0500 ---- b/qpid/java/common/bin/qpid-jaddr 2013-07-30 16:23:13.000000000 -0500 -*************** -*** 24,30 **** - fi - - # Set classpath to include Qpid jar with all required jars in manifest -! QPID_LIBS=$QPID_HOME/lib/qpid-all.jar - - # Set other variables used by the qpid-run script before calling - export JAVA=java \ ---- 24,30 ---- - fi - - # Set classpath to include Qpid jar with all required jars in manifest -! QPID_LIBS="$QPID_HOME/lib/qpid-all.jar:$QPID_HOME/lib/opt/*:$QPID_HOME/lib/opt/qpid-deps/*" - - # Set other variables used by the qpid-run script before calling - export JAVA=java \ -diff -crB a/qpid/java/common/bin/qpid-run b/qpid/java/common/bin/qpid-run -*** a/qpid/java/common/bin/qpid-run 2012-02-15 09:29:22.000000000 -0600 ---- b/qpid/java/common/bin/qpid-run 2013-07-30 16:23:13.000000000 -0500 -*************** -*** 62,69 **** - fi - - if [ -z "$QPID_WORK" ]; then -! log $INFO Setting QPID_WORK to $HOME as default -! QPID_WORK=$HOME - fi - - if [ -z "$JAVA" ]; then ---- 62,68 ---- - fi - - if [ -z "$QPID_WORK" ]; then -! QPID_WORK=$QPID_HOME - fi - - if [ -z "$JAVA" ]; then diff --git a/rpms/awips2.qpid/0.18/SOURCES/awips2/commons-configuration-1.8.jar b/rpms/awips2.qpid/0.18/SOURCES/awips2/commons-configuration-1.8.jar deleted file mode 100644 index ae9ae9969b..0000000000 Binary files a/rpms/awips2.qpid/0.18/SOURCES/awips2/commons-configuration-1.8.jar and /dev/null differ diff --git a/rpms/awips2.qpid/0.18/SOURCES/awips2/commons-logging-1.1.2.jar b/rpms/awips2.qpid/0.18/SOURCES/awips2/commons-logging-1.1.2.jar deleted file mode 100644 index d6a543c4ed..0000000000 Binary files a/rpms/awips2.qpid/0.18/SOURCES/awips2/commons-logging-1.1.2.jar and /dev/null differ diff --git a/rpms/awips2.qpid/0.18/SOURCES/awips2/dependencies.txt b/rpms/awips2.qpid/0.18/SOURCES/awips2/dependencies.txt deleted file mode 100644 index 0164c36768..0000000000 --- a/rpms/awips2.qpid/0.18/SOURCES/awips2/dependencies.txt +++ /dev/null @@ -1,10 +0,0 @@ -org.apache.commons.cli/commons-cli-1.2.jar -org.apache.xalan/xalan-2.7.2.jar -org.apache.commons.beanutils/commons-beanutils-1.8.3.jar -org.apache.commons.digester/commons-digester-1.8.1.jar -org.apache.commons.codec/commons-codec-1.4.jar -org.apache.commons.lang/commons-lang-2.3.jar -org.apache.commons.collections/commons-collections-3.2.jar -org.codehaus.jackson/jackson-core-asl-1.7.3.jar -org.codehaus.jackson/jackson-mapper-asl-1.7.3.jar -org.mockito/mockito-all-1.9.0.jar diff --git a/rpms/awips2.qpid/0.18/SOURCES/awips2/derby.jar b/rpms/awips2.qpid/0.18/SOURCES/awips2/derby.jar deleted file mode 100644 index b59555907a..0000000000 Binary files a/rpms/awips2.qpid/0.18/SOURCES/awips2/derby.jar and /dev/null differ diff --git a/rpms/awips2.qpid/0.18/SOURCES/awips2/dojo-war-1.7.2.war b/rpms/awips2.qpid/0.18/SOURCES/awips2/dojo-war-1.7.2.war deleted file mode 100644 index e42e2a4b9f..0000000000 Binary files a/rpms/awips2.qpid/0.18/SOURCES/awips2/dojo-war-1.7.2.war and /dev/null differ diff --git a/rpms/awips2.qpid/0.18/SOURCES/awips2/geronimo-servlet_2.5_spec-1.1.2.jar b/rpms/awips2.qpid/0.18/SOURCES/awips2/geronimo-servlet_2.5_spec-1.1.2.jar deleted file mode 100644 index 94733327f2..0000000000 Binary files a/rpms/awips2.qpid/0.18/SOURCES/awips2/geronimo-servlet_2.5_spec-1.1.2.jar and /dev/null differ diff --git a/rpms/awips2.qpid/0.18/SOURCES/awips2/jetty-continuation-7.6.3.v20120416.jar b/rpms/awips2.qpid/0.18/SOURCES/awips2/jetty-continuation-7.6.3.v20120416.jar deleted file mode 100644 index 0aa38b8fb9..0000000000 Binary files a/rpms/awips2.qpid/0.18/SOURCES/awips2/jetty-continuation-7.6.3.v20120416.jar and /dev/null differ diff --git a/rpms/awips2.qpid/0.18/SOURCES/awips2/jetty-http-7.6.3.v20120416.jar b/rpms/awips2.qpid/0.18/SOURCES/awips2/jetty-http-7.6.3.v20120416.jar deleted file mode 100644 index 297f2e0953..0000000000 Binary files a/rpms/awips2.qpid/0.18/SOURCES/awips2/jetty-http-7.6.3.v20120416.jar and /dev/null differ diff --git a/rpms/awips2.qpid/0.18/SOURCES/awips2/jetty-io-7.6.3.v20120416.jar b/rpms/awips2.qpid/0.18/SOURCES/awips2/jetty-io-7.6.3.v20120416.jar deleted file mode 100644 index a0496268b8..0000000000 Binary files a/rpms/awips2.qpid/0.18/SOURCES/awips2/jetty-io-7.6.3.v20120416.jar and /dev/null differ diff --git a/rpms/awips2.qpid/0.18/SOURCES/awips2/jetty-security-7.6.3.v20120416.jar b/rpms/awips2.qpid/0.18/SOURCES/awips2/jetty-security-7.6.3.v20120416.jar deleted file mode 100644 index 9f428298e2..0000000000 Binary files a/rpms/awips2.qpid/0.18/SOURCES/awips2/jetty-security-7.6.3.v20120416.jar and /dev/null differ diff --git a/rpms/awips2.qpid/0.18/SOURCES/awips2/jetty-server-7.6.3.v20120416.jar b/rpms/awips2.qpid/0.18/SOURCES/awips2/jetty-server-7.6.3.v20120416.jar deleted file mode 100644 index 7dcfd1cd85..0000000000 Binary files a/rpms/awips2.qpid/0.18/SOURCES/awips2/jetty-server-7.6.3.v20120416.jar and /dev/null differ diff --git a/rpms/awips2.qpid/0.18/SOURCES/awips2/jetty-servlet-7.6.3.v20120416.jar b/rpms/awips2.qpid/0.18/SOURCES/awips2/jetty-servlet-7.6.3.v20120416.jar deleted file mode 100644 index fc0bc16c1a..0000000000 Binary files a/rpms/awips2.qpid/0.18/SOURCES/awips2/jetty-servlet-7.6.3.v20120416.jar and /dev/null differ diff --git a/rpms/awips2.qpid/0.18/SOURCES/awips2/jetty-util-7.6.3.v20120416.jar b/rpms/awips2.qpid/0.18/SOURCES/awips2/jetty-util-7.6.3.v20120416.jar deleted file mode 100644 index e3ba8cf14c..0000000000 Binary files a/rpms/awips2.qpid/0.18/SOURCES/awips2/jetty-util-7.6.3.v20120416.jar and /dev/null differ diff --git a/rpms/awips2.qpid/0.18/SOURCES/awips2/jetty-websocket-7.6.3.v20120416.jar b/rpms/awips2.qpid/0.18/SOURCES/awips2/jetty-websocket-7.6.3.v20120416.jar deleted file mode 100644 index 1912e971cb..0000000000 Binary files a/rpms/awips2.qpid/0.18/SOURCES/awips2/jetty-websocket-7.6.3.v20120416.jar and /dev/null differ diff --git a/rpms/awips2.qpid/0.18/SOURCES/awips2/org.apache.felix.main-2.0.5.jar b/rpms/awips2.qpid/0.18/SOURCES/awips2/org.apache.felix.main-2.0.5.jar deleted file mode 100644 index 71e5a84231..0000000000 Binary files a/rpms/awips2.qpid/0.18/SOURCES/awips2/org.apache.felix.main-2.0.5.jar and /dev/null differ diff --git a/rpms/awips2.qpid/0.18/SOURCES/awips2/slf4j-log4j12-1.7.5.jar b/rpms/awips2.qpid/0.18/SOURCES/awips2/slf4j-log4j12-1.7.5.jar deleted file mode 100644 index afce5c21f1..0000000000 Binary files a/rpms/awips2.qpid/0.18/SOURCES/awips2/slf4j-log4j12-1.7.5.jar and /dev/null differ diff --git a/rpms/awips2.qpid/0.18/SOURCES/build.patch b/rpms/awips2.qpid/0.18/SOURCES/build.patch deleted file mode 100644 index 0e1cd77bd0..0000000000 --- a/rpms/awips2.qpid/0.18/SOURCES/build.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/qpid/java/build.xml b/qpid/java/build.xml -index a41cff4..06e8c8a 100644 ---- a/qpid/java/build.xml -+++ b/qpid/java/build.xml -@@ -161,7 +161,7 @@ - - - -- -+ - - - diff --git a/rpms/awips2.qpid/0.18/SOURCES/config.xml b/rpms/awips2.qpid/0.18/SOURCES/config.xml deleted file mode 100644 index 6f18bba4ff..0000000000 --- a/rpms/awips2.qpid/0.18/SOURCES/config.xml +++ /dev/null @@ -1,121 +0,0 @@ - - - - - ${QPID_HOME} - ${QPID_WORK} - ${prefix}/etc - - ${QPID_HOME}/lib/opt - ${QPID_WORK}/cache - - - - - false - 5671 - false - /path/to/keystore.ks - keystorepass - - 5672 - 32768 - 16384 - - - true - - 8999 - - - - false - - ${conf}/qpid.keystore - password - - - true - 8180 - false - false - 600 - - - false - - - - 65535 - en_US - - - - - - org.apache.qpid.server.security.auth.database.PlainPasswordFilePrincipalDatabase - - - passwordFile - ${conf}/passwd - - - - - - - - - - false - - - ${conf}/virtualhosts.xml - - - 0 - 2.0 - - - true - - - ON - - diff --git a/rpms/awips2.qpid/0.18/SOURCES/examples.patch b/rpms/awips2.qpid/0.18/SOURCES/examples.patch deleted file mode 100644 index 518cb93df5..0000000000 --- a/rpms/awips2.qpid/0.18/SOURCES/examples.patch +++ /dev/null @@ -1,96 +0,0 @@ -From 4acdbf975c076c2c49e7e2436065ca7d18dfab20 Mon Sep 17 00:00:00 2001 -From: rajith -Date: Wed, 16 Jun 2010 16:37:11 -0400 -Subject: [PATCH 02/52] These two files are not present in upstream and we currently carry them as a patch. - The reason being that the run_example.sh is tailored specific for the linux env. - Including the example.log4j depends on how the release artefacts will look like for the 0.7 qpid release. - ---- - qpid/java/client/example/bin/run_example.sh | 43 +++++++++++++++++++++++++++ - qpid/java/client/example/example.log4j | 27 +++++++++++++++++ - 2 files changed, 70 insertions(+), 0 deletions(-) - create mode 100644 qpid/java/client/example/bin/run_example.sh - create mode 100644 qpid/java/client/example/example.log4j - -diff --git a/qpid/java/client/example/bin/run_example.sh b/qpid/java/client/example/bin/run_example.sh -new file mode 100644 -index 0000000..5bd0e99 ---- /dev/null -+++ b/qpid/java/client/example/bin/run_example.sh -@@ -0,0 +1,43 @@ -+#!/bin/bash -+ -+# -+# 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. -+# -+ -+# set the CLASSPATH -+QPID_DEPS=`find /usr/share/java/qpid-deps/*.jar | tr '\n' ":"` -+QPID_JARS=`find /usr/share/java -name 'qpid-client*.jar' -or -name 'qpid-common*.jar' | tr '\n' ":"` -+LOG4J="/usr/share/java/log4j.jar" -+QPID_CLASSPATH=$QPID_DEPS$LOG4J:$QPID_JARS -+ -+# compile the samples -+javac -cp "$QPID_CLASSPATH" -sourcepath "$PWD" -d . `find $PWD -name '*.java'` -+ -+# Add output classes to CLASSPATH -+QPID_CLASSPATH="$PWD:$QPID_CLASSPATH" -+ -+ -+# Check if the user supplied a sample classname -+if test "'x$1'" = "'x'" -+then -+ echo "No sample classname specified" -+ exit; -+else -+ java -cp $QPID_CLASSPATH -Dlog4j.configuration=example.log4j "$@" -+fi -+ -diff --git a/qpid/java/client/example/example.log4j b/qpid/java/client/example/example.log4j -new file mode 100644 -index 0000000..50b4ed2 ---- /dev/null -+++ b/qpid/java/client/example/example.log4j -@@ -0,0 +1,27 @@ -+# -+# 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. -+# -+ -+log4j.logger.org.apache.qpid=WARN, console -+log4j.additivity.org.apache.qpid=false -+ -+ -+log4j.appender.console=org.apache.log4j.ConsoleAppender -+log4j.appender.console.Threshold=all -+log4j.appender.console.layout=org.apache.log4j.PatternLayout -+log4j.appender.console.layout.ConversionPattern=%t %d %p [%c{4}] %m%n diff --git a/rpms/awips2.qpid/0.18/SOURCES/log4j.xml b/rpms/awips2.qpid/0.18/SOURCES/log4j.xml deleted file mode 100644 index 4ada971857..0000000000 --- a/rpms/awips2.qpid/0.18/SOURCES/log4j.xml +++ /dev/null @@ -1,130 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/rpms/awips2.qpid/0.18/SOURCES/mrg.patch b/rpms/awips2.qpid/0.18/SOURCES/mrg.patch deleted file mode 100644 index 5bc1665d34..0000000000 --- a/rpms/awips2.qpid/0.18/SOURCES/mrg.patch +++ /dev/null @@ -1,4090 +0,0 @@ -From 862f9df4e6e14995b80f8162601959a61ca765d4 Mon Sep 17 00:00:00 2001 -From: Kenneth Giusti -Date: Wed, 5 Sep 2012 13:25:51 -0400 -Subject: [PATCH 01/19] BZ854004: perform header lookup while the message is locked. - ---- - qpid/cpp/src/qpid/broker/Message.cpp | 9 +++++++++ - qpid/cpp/src/qpid/broker/Message.h | 1 + - qpid/cpp/src/qpid/broker/MessageGroupManager.cpp | 13 +++++-------- - 3 files changed, 15 insertions(+), 8 deletions(-) - -diff --git a/qpid/cpp/src/qpid/broker/Message.cpp b/qpid/cpp/src/qpid/broker/Message.cpp -index 4dd8a34..1a91504 100644 ---- a/qpid/cpp/src/qpid/broker/Message.cpp -+++ b/qpid/cpp/src/qpid/broker/Message.cpp -@@ -100,6 +100,15 @@ const FieldTable* Message::getApplicationHeaders() const - return getAdapter().getApplicationHeaders(frames); - } - -+const FieldTable::ValuePtr Message::getApplicationHeader(const std::string& name) const -+{ -+ sys::Mutex::ScopedLock l(lock); -+ -+ const FieldTable *ft = getAdapter().getApplicationHeaders(frames); -+ if (!ft) return FieldTable::ValuePtr(); -+ return ft->get( name ); -+} -+ - std::string Message::getAppId() const - { - sys::Mutex::ScopedLock l(lock); -diff --git a/qpid/cpp/src/qpid/broker/Message.h b/qpid/cpp/src/qpid/broker/Message.h -index 90e4eec..f002001 100644 ---- a/qpid/cpp/src/qpid/broker/Message.h -+++ b/qpid/cpp/src/qpid/broker/Message.h -@@ -77,6 +77,7 @@ public: - QPID_BROKER_EXTERN std::string getExchangeName() const; - bool isImmediate() const; - QPID_BROKER_EXTERN const framing::FieldTable* getApplicationHeaders() const; -+ QPID_BROKER_EXTERN const framing::FieldTable::ValuePtr getApplicationHeader(const std::string&) const; - QPID_BROKER_EXTERN std::string getAppId() const; - QPID_BROKER_EXTERN bool isPersistent() const; - bool requiresAccept(); -diff --git a/qpid/cpp/src/qpid/broker/MessageGroupManager.cpp b/qpid/cpp/src/qpid/broker/MessageGroupManager.cpp -index 15cd56a..bc5d797 100644 ---- a/qpid/cpp/src/qpid/broker/MessageGroupManager.cpp -+++ b/qpid/cpp/src/qpid/broker/MessageGroupManager.cpp -@@ -84,14 +84,11 @@ MessageGroupManager::GroupState& MessageGroupManager::findGroup( const QueuedMes - } - - std::string group = defaultGroupId; -- const qpid::framing::FieldTable* headers = qm.payload->getApplicationHeaders(); -- if (headers) { -- qpid::framing::FieldTable::ValuePtr id = headers->get( groupIdHeader ); -- if (id && id->convertsTo()) { -- std::string tmp = id->get(); -- if (!tmp.empty()) // empty group is reserved -- group = tmp; -- } -+ const qpid::framing::FieldTable::ValuePtr id = qm.payload->getApplicationHeader(groupIdHeader); -+ if (id && id->convertsTo()) { -+ std::string tmp = id->get(); -+ if (!tmp.empty()) // empty group is reserved -+ group = tmp; - } - - if (cachedGroup && group == lastGroup) { --- -1.7.1 - -From ccf535a5a75e413557385adcc6874d8a47af1c17 Mon Sep 17 00:00:00 2001 -From: Kenneth Giusti -Date: Thu, 6 Sep 2012 10:03:44 -0400 -Subject: [PATCH 02/19] BZ854004 - remove risky use of broker::Message::getApplicationHeaders() - ---- - qpid/cpp/src/qpid/broker/Link.cpp | 5 +++-- - qpid/cpp/src/qpid/broker/Message.cpp | 11 ++++++++--- - qpid/cpp/src/qpid/broker/Message.h | 4 ++++ - qpid/cpp/src/qpid/broker/MessageMap.cpp | 5 +++-- - qpid/cpp/src/qpid/broker/Queue.cpp | 4 +--- - qpid/cpp/src/qpid/broker/ThresholdAlerts.cpp | 5 +++-- - qpid/cpp/src/qpid/cluster/CredentialsExchange.cpp | 7 ++++--- - 7 files changed, 26 insertions(+), 15 deletions(-) - -diff --git a/qpid/cpp/src/qpid/broker/Link.cpp b/qpid/cpp/src/qpid/broker/Link.cpp -index 84dd163..a853240 100644 ---- a/qpid/cpp/src/qpid/broker/Link.cpp -+++ b/qpid/cpp/src/qpid/broker/Link.cpp -@@ -33,6 +33,7 @@ - #include "qpid/broker/AclModule.h" - #include "qpid/broker/Exchange.h" - #include "qpid/UrlArray.h" -+#include "qpid/framing/FieldValue.h" - - namespace qpid { - namespace broker { -@@ -95,9 +96,9 @@ public: - void route(broker::Deliverable& msg) - { - if (!link) return; -- const framing::FieldTable* headers = msg.getMessage().getApplicationHeaders(); -+ const framing::FieldTable::ValuePtr header = msg.getMessage().getApplicationHeader(FAILOVER_HEADER_KEY); - framing::Array addresses; -- if (headers && headers->getArray(FAILOVER_HEADER_KEY, addresses)) { -+ if (header && framing::getEncodedValue(header, addresses)) { - // convert the Array of addresses to a single Url container for used with setUrl(): - std::vector urlVec; - Url urls; -diff --git a/qpid/cpp/src/qpid/broker/Message.cpp b/qpid/cpp/src/qpid/broker/Message.cpp -index 1a91504..d8719c7 100644 ---- a/qpid/cpp/src/qpid/broker/Message.cpp -+++ b/qpid/cpp/src/qpid/broker/Message.cpp -@@ -94,17 +94,22 @@ bool Message::isImmediate() const - return getAdapter().isImmediate(frames); - } - -+const FieldTable* Message::getApplicationHeadersLH() const -+{ -+ return getAdapter().getApplicationHeaders(frames); -+} -+ - const FieldTable* Message::getApplicationHeaders() const - { - sys::Mutex::ScopedLock l(lock); -- return getAdapter().getApplicationHeaders(frames); -+ return getApplicationHeadersLH(); - } - - const FieldTable::ValuePtr Message::getApplicationHeader(const std::string& name) const - { - sys::Mutex::ScopedLock l(lock); - -- const FieldTable *ft = getAdapter().getApplicationHeaders(frames); -+ const FieldTable *ft = getApplicationHeadersLH(); - if (!ft) return FieldTable::ValuePtr(); - return ft->get( name ); - } -@@ -339,7 +344,7 @@ const std::string X_QPID_TRACE("x-qpid.trace"); - bool Message::isExcluded(const std::vector& excludes) const - { - sys::Mutex::ScopedLock l(lock); -- const FieldTable* headers = getApplicationHeaders(); -+ const FieldTable* headers = getApplicationHeadersLH(); - if (headers) { - std::string traceStr = headers->getAsString(X_QPID_TRACE); - if (traceStr.size()) { -diff --git a/qpid/cpp/src/qpid/broker/Message.h b/qpid/cpp/src/qpid/broker/Message.h -index f002001..7af2f00 100644 ---- a/qpid/cpp/src/qpid/broker/Message.h -+++ b/qpid/cpp/src/qpid/broker/Message.h -@@ -76,6 +76,9 @@ public: - const boost::shared_ptr getExchange(ExchangeRegistry&) const; - QPID_BROKER_EXTERN std::string getExchangeName() const; - bool isImmediate() const; -+ // Note: getApplicationHeaders() cannot be used when the message is shared between queues (or threads). -+ // The returned FieldTable will be deallocated should another thread rewrite the message headers! -+ // See BZ854004. When in doubt, don't use this method - use getApplicationHeader() instead. - QPID_BROKER_EXTERN const framing::FieldTable* getApplicationHeaders() const; - QPID_BROKER_EXTERN const framing::FieldTable::ValuePtr getApplicationHeader(const std::string&) const; - QPID_BROKER_EXTERN std::string getAppId() const; -@@ -210,6 +213,7 @@ public: - return getHeaderBody()->get(true); - } - qpid::framing::AMQHeaderBody* getHeaderBody(); -+ const qpid::framing::FieldTable* getApplicationHeadersLH() const; - }; - - }} -diff --git a/qpid/cpp/src/qpid/broker/MessageMap.cpp b/qpid/cpp/src/qpid/broker/MessageMap.cpp -index 592f3fe..de0137e 100644 ---- a/qpid/cpp/src/qpid/broker/MessageMap.cpp -+++ b/qpid/cpp/src/qpid/broker/MessageMap.cpp -@@ -21,6 +21,7 @@ - #include "qpid/broker/MessageMap.h" - #include "qpid/broker/QueuedMessage.h" - #include "qpid/log/Statement.h" -+#include "qpid/framing/FieldValue.h" - #include - - namespace qpid { -@@ -42,8 +43,8 @@ bool MessageMap::deleted(const QueuedMessage& message) - - std::string MessageMap::getKey(const QueuedMessage& message) - { -- const framing::FieldTable* ft = message.payload->getApplicationHeaders(); -- if (ft) return ft->getAsString(key); -+ const framing::FieldTable::ValuePtr val = message.payload->getApplicationHeader(key); -+ if (val && val->convertsTo()) return val->get(); - else return EMPTY; - } - -diff --git a/qpid/cpp/src/qpid/broker/Queue.cpp b/qpid/cpp/src/qpid/broker/Queue.cpp -index 3202a26..561ac99 100644 ---- a/qpid/cpp/src/qpid/broker/Queue.cpp -+++ b/qpid/cpp/src/qpid/broker/Queue.cpp -@@ -688,9 +688,7 @@ namespace { - : MessageFilter (), header(_header), value(_value) {} - bool match( const QueuedMessage& msg ) const - { -- const qpid::framing::FieldTable* headers = msg.payload->getApplicationHeaders(); -- if (!headers) return false; -- FieldTable::ValuePtr h = headers->get(header); -+ const FieldTable::ValuePtr h = msg.payload->getApplicationHeader(header); - if (!h || !h->convertsTo()) return false; - return h->get() == value; - } -diff --git a/qpid/cpp/src/qpid/broker/ThresholdAlerts.cpp b/qpid/cpp/src/qpid/broker/ThresholdAlerts.cpp -index 3c9e210..c0fe733 100644 ---- a/qpid/cpp/src/qpid/broker/ThresholdAlerts.cpp -+++ b/qpid/cpp/src/qpid/broker/ThresholdAlerts.cpp -@@ -25,6 +25,7 @@ - #include "qpid/log/Statement.h" - #include "qpid/management/ManagementAgent.h" - #include "qmf/org/apache/qpid/broker/EventQueueThresholdExceeded.h" -+#include "qpid/framing/FieldValue.h" - - namespace qpid { - namespace broker { -@@ -41,8 +42,8 @@ bool isThresholdEvent(const boost::intrusive_ptr message) - if (message->getIsManagementMessage()) { - //is this a qmf event? if so is it a threshold event? - if (isQMFv2(message)) { -- const qpid::framing::FieldTable* headers = message->getApplicationHeaders(); -- if (headers && headers->getAsString("qmf.content") == "_event") { -+ const qpid::framing::FieldTable::ValuePtr header = message->getApplicationHeader("qmf.content"); -+ if (header && header->convertsTo() && header->get() == std::string("_event")) { - //decode as list - std::string content = message->getFrames().getContent(); - qpid::types::Variant::List list; -diff --git a/qpid/cpp/src/qpid/cluster/CredentialsExchange.cpp b/qpid/cpp/src/qpid/cluster/CredentialsExchange.cpp -index 416a363..93488a6 100644 ---- a/qpid/cpp/src/qpid/cluster/CredentialsExchange.cpp -+++ b/qpid/cpp/src/qpid/cluster/CredentialsExchange.cpp -@@ -23,6 +23,7 @@ - #include "qpid/broker/ConnectionState.h" - #include "qpid/framing/reply_exceptions.h" - #include "qpid/sys/Time.h" -+#include "qpid/framing/FieldValue.h" - - namespace qpid { - namespace cluster { -@@ -63,7 +64,7 @@ bool CredentialsExchange::check(MemberId member) { - } - - void CredentialsExchange::route(broker::Deliverable& msg) { -- const framing::FieldTable* args = msg.getMessage().getApplicationHeaders(); -+ const framing::FieldTable::ValuePtr name = msg.getMessage().getApplicationHeader(NAME); - sys::Mutex::ScopedLock l(lock); - const broker::ConnectionState* connection = - static_cast(msg.getMessage().getPublisher()); -@@ -71,10 +72,10 @@ void CredentialsExchange::route(broker::Deliverable& msg) { - throw framing::UnauthorizedAccessException( - QPID_MSG("Unauthorized user " << connection->getUserId() << " for " << NAME - << ", should be " << username)); -- if (!args || !args->isSet(NAME)) -+ if (!name) - throw framing::InvalidArgumentException( - QPID_MSG("Invalid message received by " << NAME)); -- MemberId member(args->getAsUInt64(NAME)); -+ MemberId member(name->getIntegerValue()); - map[member] = sys::AbsTime::now(); - } - --- -1.7.1 - -From e4b8f2996de58d5d80a969c804973254bbf569a8 Mon Sep 17 00:00:00 2001 -From: Rajith Muditha Attapattu -Date: Fri, 31 Aug 2012 15:30:55 +0000 -Subject: [PATCH 03/19] Bug 852030, QPID-4267: Prevent multiple inclusion of ra.xml and jboss-ra.xml files in JCA jar and JCA rar - -git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1379478 13f79535-47bb-0310-9956-ffa450edef68 ---- - qpid/java/jca/build.xml | 13 +++++++++++-- - 1 files changed, 11 insertions(+), 2 deletions(-) - -diff --git a/qpid/java/jca/build.xml b/qpid/java/jca/build.xml -index 934514a..3f34cc9 100644 ---- a/qpid/java/jca/build.xml -+++ b/qpid/java/jca/build.xml -@@ -29,9 +29,18 @@ - - - -- -- -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ - -+ - - - --- -1.7.1 - -From cd6505a2a66349390be44712f632d72fcaa66ed7 Mon Sep 17 00:00:00 2001 -From: Rajith Muditha Attapattu -Date: Thu, 6 Sep 2012 14:41:29 +0000 -Subject: [PATCH 04/19] Bug 851574, QPID-4288: The pid and platform info are now fetched in a static block - and the cached value is returned. - -git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1381625 13f79535-47bb-0310-9956-ffa450edef68 ---- - .../qpid/properties/ConnectionStartProperties.java | 27 ++++++++++++++------ - 1 files changed, 19 insertions(+), 8 deletions(-) - -diff --git a/qpid/java/common/src/main/java/org/apache/qpid/properties/ConnectionStartProperties.java b/qpid/java/common/src/main/java/org/apache/qpid/properties/ConnectionStartProperties.java -index 15c144b..59a1b6c 100644 ---- a/qpid/java/common/src/main/java/org/apache/qpid/properties/ConnectionStartProperties.java -+++ b/qpid/java/common/src/main/java/org/apache/qpid/properties/ConnectionStartProperties.java -@@ -49,7 +49,11 @@ public class ConnectionStartProperties - - public static final String SESSION_FLOW = "qpid.session_flow"; - -- public static int getPID() -+ public static int _pid; -+ -+ public static final String _platformInfo; -+ -+ static - { - RuntimeMXBean rtb = ManagementFactory.getRuntimeMXBean(); - String processName = rtb.getName(); -@@ -57,23 +61,20 @@ public class ConnectionStartProperties - { - try - { -- return Integer.parseInt(processName.substring(0,processName.indexOf('@'))); -+ _pid = Integer.parseInt(processName.substring(0,processName.indexOf('@'))); - } - catch(Exception e) - { - LOGGER.warn("Unable to get the PID due to error",e); -- return -1; -+ _pid = -1; - } - } - else - { - LOGGER.warn("Unable to get the PID due to unsupported format : " + processName); -- return -1; -+ _pid = -1; - } -- } - -- public static String getPlatformInfo() -- { - StringBuilder fullSystemInfo = new StringBuilder(System.getProperty("java.runtime.name")); - fullSystemInfo.append(", "); - fullSystemInfo.append(System.getProperty("java.runtime.version")); -@@ -88,6 +89,16 @@ public class ConnectionStartProperties - fullSystemInfo.append(", "); - fullSystemInfo.append(System.getProperty("sun.os.patch.level")); - -- return fullSystemInfo.toString(); -+ _platformInfo = fullSystemInfo.toString(); -+ } -+ -+ public static int getPID() -+ { -+ return _pid; -+ } -+ -+ public static String getPlatformInfo() -+ { -+ return _platformInfo; - } - } --- -1.7.1 - -From fd604472e4dcc8b5e7042503450a9f81c572dc6a Mon Sep 17 00:00:00 2001 -From: Charles E. Rolke -Date: Sun, 15 Jul 2012 10:17:26 +0000 -Subject: [PATCH 05/19] QPID-3892 C++ broker add routing key wildcard support to Acl 'publish exchange' lookups. Although this patch does not address the original issue's regex request it provides the desired functionality in a more comprehensive manner. - -* Acl publish exchange rules may specify routing keys using the topic exchange syntax with '*' and '#' wildcard match tokens. -* Acl lookups hook in to the broker's topic exchange key match code to perform the wildcard match. -* Acl rules written using the old Acl wildcard syntax (with a single trailing '*') will continue to work the same as before. - -git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1361678 13f79535-47bb-0310-9956-ffa450edef68 ---- - qpid/cpp/src/qpid/acl/AclData.cpp | 81 ++++++++++------------ - qpid/cpp/src/qpid/acl/AclData.h | 38 +++++++++-- - qpid/cpp/src/qpid/acl/AclReader.cpp | 29 ++++++-- - qpid/cpp/src/qpid/acl/AclReader.h | 1 + - qpid/cpp/src/qpid/acl/AclValidator.cpp | 2 +- - qpid/cpp/src/qpid/acl/AclValidator.h | 2 +- - qpid/cpp/src/tests/acl.py | 120 +++++++++++++++++++++++++++++++- - 7 files changed, 215 insertions(+), 58 deletions(-) - -diff --git a/qpid/cpp/src/qpid/acl/AclData.cpp b/qpid/cpp/src/qpid/acl/AclData.cpp -index da7f240..a07176d 100644 ---- a/qpid/cpp/src/qpid/acl/AclData.cpp -+++ b/qpid/cpp/src/qpid/acl/AclData.cpp -@@ -305,7 +305,9 @@ namespace acl { - // lookup - // - // The ACL main business logic function of matching rules and declaring -- // an allow or deny result. -+ // an allow or deny result. This lookup is the fastpath per-message -+ // lookup to verify if a user is allowed to publish to an exchange with -+ // a given key. - // - AclResult AclData::lookup( - const std::string& id, -@@ -331,7 +333,8 @@ namespace acl { - - if (itrRule != actionList[action][objType]->end() ) - { -- //loop the vector -+ // Found a rule list for this user-action-object set. -+ // Search the rule list for a matching rule. - ruleSetItr rsItr = itrRule->second.end(); - for (int cnt = itrRule->second.size(); cnt != 0; cnt--) - { -@@ -339,56 +342,46 @@ namespace acl { - - QPID_LOG(debug, "ACL: checking rule " << rsItr->toString()); - -- // loop the names looking for match -+ // Search on exchange name and routing key only if specfied in rule. - bool match =true; -- for (specPropertyMapItr pMItr = rsItr->props.begin(); -- (pMItr != rsItr->props.end()) && match; -- pMItr++) -+ if (rsItr->pubExchNameInRule) - { -- //match name is exists first -- switch (pMItr->first) -+ if (matchProp(rsItr->pubExchName, name)) - { -- case acl::SPECPROP_NAME: -- if (matchProp(pMItr->second, name)) -- { -- QPID_LOG(debug, "ACL: lookup exchange name '" -- << name << "' matched with rule name '" -- << pMItr->second << "'"); -- -- } -- else -- { -- match= false; -- QPID_LOG(debug, "ACL: lookup exchange name '" -- << name << "' did not match with rule name '" -- << pMItr->second << "'"); -- } -- break; -+ QPID_LOG(debug, "ACL: Rule: " << rsItr->rawRuleNum << " lookup exchange name '" -+ << name << "' matched with rule name '" -+ << rsItr->pubExchName << "'"); - -- case acl::SPECPROP_ROUTINGKEY: -- if (matchProp(pMItr->second, routingKey)) -- { -- QPID_LOG(debug, "ACL: lookup key name '" -- << routingKey << "' matched with rule routing key '" -- << pMItr->second << "'"); -- } -- else -- { -- match= false; -- QPID_LOG(debug, "ACL: lookup key name '" -- << routingKey << "' did not match with rule routing key '" -- << pMItr->second << "'"); -- } -- break; -+ } -+ else -+ { -+ match= false; -+ QPID_LOG(debug, "ACL: Rule: " << rsItr->rawRuleNum << " lookup exchange name '" -+ << name << "' did not match with rule name '" -+ << rsItr->pubExchName << "'"); -+ } -+ } - -- default: -- // Don't care -- break; -- }; -+ if (match && rsItr->pubRoutingKeyInRule) -+ { -+ if (rsItr->matchRoutingKey(routingKey)) -+ { -+ QPID_LOG(debug, "ACL: Rule: " << rsItr->rawRuleNum << " lookup key name '" -+ << routingKey << "' matched with rule routing key '" -+ << rsItr->pubRoutingKey << "'"); -+ } -+ else -+ { -+ QPID_LOG(debug, "ACL: Rule: " << rsItr->rawRuleNum << " lookup key name '" -+ << routingKey << "' did not match with rule routing key '" -+ << rsItr->pubRoutingKey << "'"); -+ match = false; -+ } - } -+ - if (match){ - aclresult = rsItr->ruleMode; -- QPID_LOG(debug,"ACL: Successful match, the decision is:" -+ QPID_LOG(debug,"ACL: Rule: " << rsItr->rawRuleNum << " Successful match, the decision is:" - << AclHelper::getAclResultStr(aclresult)); - return aclresult; - } -diff --git a/qpid/cpp/src/qpid/acl/AclData.h b/qpid/cpp/src/qpid/acl/AclData.h -index 1c1cb3e..ca0a676 100644 ---- a/qpid/cpp/src/qpid/acl/AclData.h -+++ b/qpid/cpp/src/qpid/acl/AclData.h -@@ -21,6 +21,9 @@ - */ - - #include "qpid/broker/AclModule.h" -+#include "AclTopicMatch.h" -+#include "qpid/log/Statement.h" -+#include "boost/shared_ptr.hpp" - #include - #include - -@@ -48,18 +51,29 @@ public: - // A single ACL file entry may create many rule entries in - // many ruleset vectors. - // -- struct rule { -+ struct Rule { -+ typedef broker::TopicExchange::TopicExchangeTester topicTester; - - int rawRuleNum; // rule number in ACL file - qpid::acl::AclResult ruleMode; // combined allow/deny log/nolog - specPropertyMap props; // -+ bool pubRoutingKeyInRule; -+ std::string pubRoutingKey; -+ boost::shared_ptr pTTest; -+ bool pubExchNameInRule; -+ std::string pubExchName; - -- -- rule (int ruleNum, qpid::acl::AclResult res, specPropertyMap& p) : -+ Rule (int ruleNum, qpid::acl::AclResult res, specPropertyMap& p) : - rawRuleNum(ruleNum), - ruleMode(res), -- props(p) -- {}; -+ props(p), -+ pubRoutingKeyInRule(false), -+ pubRoutingKey(), -+ pTTest(boost::shared_ptr(new topicTester())), -+ pubExchNameInRule(false), -+ pubExchName() -+ {} -+ - - std::string toString () const { - std::ostringstream ruleStr; -@@ -76,9 +90,21 @@ public: - ruleStr << " }]"; - return ruleStr.str(); - } -+ -+ void addTopicTest(const std::string& pattern) { -+ pTTest->addBindingKey(broker::TopicExchange::normalize(pattern)); -+ } -+ -+ // Topic Exchange tester -+ // return true if any bindings match 'pattern' -+ bool matchRoutingKey(const std::string& pattern) const -+ { -+ topicTester::BindingVec bv; -+ return pTTest->findMatches(pattern, bv); -+ } - }; - -- typedef std::vector ruleSet; -+ typedef std::vector ruleSet; - typedef ruleSet::const_iterator ruleSetItr; - typedef std::map actionObject; // user - typedef actionObject::iterator actObjItr; -diff --git a/qpid/cpp/src/qpid/acl/AclReader.cpp b/qpid/cpp/src/qpid/acl/AclReader.cpp -index 0830f3f..f9be49b 100644 ---- a/qpid/cpp/src/qpid/acl/AclReader.cpp -+++ b/qpid/cpp/src/qpid/acl/AclReader.cpp -@@ -101,7 +101,7 @@ namespace acl { - << AclHelper::getAclResultStr(d->decisionMode)); - foundmode = true; - } else { -- AclData::rule rule(cnt, (*i)->res, (*i)->props); -+ AclData::Rule rule(cnt, (*i)->res, (*i)->props); - - // Action -> Object -> map set > - std::ostringstream actionstr; -@@ -110,8 +110,27 @@ namespace acl { - (*i)->actionAll ? acnt++ : acnt = acl::ACTIONSIZE) { - - if (acnt == acl::ACT_PUBLISH) -+ { - d->transferAcl = true; // we have transfer ACL -- -+ // For Publish the only object should be Exchange -+ // and the only property should be routingkey. -+ // Go through the rule properties and find the name and the key. -+ // If found then place them specially for the lookup engine. -+ for (pmCitr pItr=(*i)->props.begin(); pItr!=(*i)->props.end(); pItr++) { -+ if (acl::SPECPROP_ROUTINGKEY == pItr->first) -+ { -+ rule.pubRoutingKeyInRule = true; -+ rule.pubRoutingKey = (std::string)pItr->second; -+ rule.addTopicTest(rule.pubRoutingKey); -+ break; -+ } -+ if (acl::SPECPROP_NAME == pItr->first) -+ { -+ rule.pubExchNameInRule = true; -+ rule.pubExchName = pItr->second; -+ } -+ } -+ } - actionstr << AclHelper::getActionStr((Action) acnt) << ","; - - //find the Action, create if not exist -@@ -285,7 +304,7 @@ namespace acl { - if (ws) { - ret = true; - } else { -- errorStream << ACL_FORMAT_ERR_LOG_PREFIX << "Line : " << lineNumber -+ errorStream << ACL_FORMAT_ERR_LOG_PREFIX << "Line : " << lineNumber - << ", Non-continuation line must start with \"group\" or \"acl\"."; - ret = false; - } -@@ -330,7 +349,7 @@ namespace acl { - } else { - const unsigned minimumSize = (cont ? 2 : 3); - if (toksSize < minimumSize) { -- errorStream << ACL_FORMAT_ERR_LOG_PREFIX << "Line : " << lineNumber -+ errorStream << ACL_FORMAT_ERR_LOG_PREFIX << "Line : " << lineNumber - << ", Insufficient tokens for group definition."; - return false; - } -@@ -479,7 +498,7 @@ namespace acl { - nvPair propNvp = splitNameValuePair(toks[i]); - if (propNvp.second.size() == 0) { - errorStream << ACL_FORMAT_ERR_LOG_PREFIX << "Line : " << lineNumber -- <<", Badly formed property name-value pair \"" -+ <<", Badly formed property name-value pair \"" - << propNvp.first << "\". (Must be name=value)"; - return false; - } -diff --git a/qpid/cpp/src/qpid/acl/AclReader.h b/qpid/cpp/src/qpid/acl/AclReader.h -index 730013f..6351c1e 100644 ---- a/qpid/cpp/src/qpid/acl/AclReader.h -+++ b/qpid/cpp/src/qpid/acl/AclReader.h -@@ -26,6 +26,7 @@ - #include - #include - #include -+#include - #include "qpid/acl/AclData.h" - #include "qpid/broker/AclModule.h" - -diff --git a/qpid/cpp/src/qpid/acl/AclValidator.cpp b/qpid/cpp/src/qpid/acl/AclValidator.cpp -index 49bb65d..85f0f7c 100644 ---- a/qpid/cpp/src/qpid/acl/AclValidator.cpp -+++ b/qpid/cpp/src/qpid/acl/AclValidator.cpp -@@ -131,7 +131,7 @@ namespace acl { - boost::bind(&AclValidator::validateRule, this, _1)); - } - -- void AclValidator::validateRule(qpid::acl::AclData::rule& rule){ -+ void AclValidator::validateRule(qpid::acl::AclData::Rule& rule){ - std::for_each(rule.props.begin(), - rule.props.end(), - boost::bind(&AclValidator::validateProperty, this, _1)); -diff --git a/qpid/cpp/src/qpid/acl/AclValidator.h b/qpid/cpp/src/qpid/acl/AclValidator.h -index f85c241..76eb222 100644 ---- a/qpid/cpp/src/qpid/acl/AclValidator.h -+++ b/qpid/cpp/src/qpid/acl/AclValidator.h -@@ -71,7 +71,7 @@ class AclValidator { - public: - - void validateRuleSet(std::pair& rules); -- void validateRule(qpid::acl::AclData::rule& rule); -+ void validateRule(qpid::acl::AclData::Rule& rule); - void validateProperty(std::pair& prop); - void validate(boost::shared_ptr d); - AclValidator(); -diff --git a/qpid/cpp/src/tests/acl.py b/qpid/cpp/src/tests/acl.py -index 663af3e..0e096a6 100755 ---- a/qpid/cpp/src/tests/acl.py -+++ b/qpid/cpp/src/tests/acl.py -@@ -310,7 +310,7 @@ class ACLTests(TestBase010): - self.fail("ACL should allow queue create request"); - self.fail("Error during queue create request"); - -- -+ - - def test_user_realm(self): - """ -@@ -1537,6 +1537,124 @@ class ACLTests(TestBase010): - - - #===================================== -+ # QMF Topic Exchange tests -+ #===================================== -+ -+ def test_qmf_topic_exchange_tests(self): -+ """ -+ Test using QMF method hooks into ACL logic -+ """ -+ aclf = self.get_acl_file() -+ aclf.write('# begin hack alert: allow anonymous to access the lookup debug functions\n') -+ aclf.write('acl allow-log anonymous create queue\n') -+ aclf.write('acl allow-log anonymous all exchange name=qmf.*\n') -+ aclf.write('acl allow-log anonymous all exchange name=amq.direct\n') -+ aclf.write('acl allow-log anonymous all exchange name=qpid.management\n') -+ aclf.write('acl allow-log anonymous access method name=*\n') -+ aclf.write('# end hack alert\n') -+ aclf.write('acl allow-log uPlain1@COMPANY publish exchange name=X routingkey=ab.cd.e\n') -+ aclf.write('acl allow-log uPlain2@COMPANY publish exchange name=X routingkey=.\n') -+ aclf.write('acl allow-log uStar1@COMPANY publish exchange name=X routingkey=a.*.b\n') -+ aclf.write('acl allow-log uStar2@COMPANY publish exchange name=X routingkey=*.x\n') -+ aclf.write('acl allow-log uStar3@COMPANY publish exchange name=X routingkey=x.x.*\n') -+ aclf.write('acl allow-log uHash1@COMPANY publish exchange name=X routingkey=a.#.b\n') -+ aclf.write('acl allow-log uHash2@COMPANY publish exchange name=X routingkey=a.#\n') -+ aclf.write('acl allow-log uHash3@COMPANY publish exchange name=X routingkey=#.a\n') -+ aclf.write('acl allow-log uHash4@COMPANY publish exchange name=X routingkey=a.#.b.#.c\n') -+ aclf.write('acl allow-log uMixed1@COMPANY publish exchange name=X routingkey=*.x.#.y\n') -+ aclf.write('acl allow-log uMixed2@COMPANY publish exchange name=X routingkey=a.#.b.*\n') -+ aclf.write('acl allow-log uMixed3@COMPANY publish exchange name=X routingkey=*.*.*.#\n') -+ -+ aclf.write('acl allow-log all publish exchange name=X routingkey=MN.OP.Q\n') -+ aclf.write('acl allow-log all publish exchange name=X routingkey=M.*.N\n') -+ aclf.write('acl allow-log all publish exchange name=X routingkey=M.#.N\n') -+ aclf.write('acl allow-log all publish exchange name=X routingkey=*.M.#.N\n') -+ -+ aclf.write('acl deny-log all all\n') -+ aclf.close() -+ -+ result = self.reload_acl() -+ if (result): -+ self.fail(result) -+ -+ # aclKey: "ab.cd.e" -+ self.LookupPublish("uPlain1@COMPANY", "X", "ab.cd.e", "allow-log") -+ self.LookupPublish("uPlain1@COMPANY", "X", "abx.cd.e", "deny-log") -+ self.LookupPublish("uPlain1@COMPANY", "X", "ab.cd", "deny-log") -+ self.LookupPublish("uPlain1@COMPANY", "X", "ab.cd..e.", "deny-log") -+ self.LookupPublish("uPlain1@COMPANY", "X", "ab.cd.e.", "deny-log") -+ self.LookupPublish("uPlain1@COMPANY", "X", ".ab.cd.e", "deny-log") -+ # aclKey: "." -+ self.LookupPublish("uPlain2@COMPANY", "X", ".", "allow-log") -+ -+ # aclKey: "a.*.b" -+ self.LookupPublish("uStar1@COMPANY", "X", "a.xx.b", "allow-log") -+ self.LookupPublish("uStar1@COMPANY", "X", "a.b", "deny-log") -+ # aclKey: "*.x" -+ self.LookupPublish("uStar2@COMPANY", "X", "y.x", "allow-log") -+ self.LookupPublish("uStar2@COMPANY", "X", ".x", "allow-log") -+ self.LookupPublish("uStar2@COMPANY", "X", "x", "deny-log") -+ # aclKey: "x.x.*" -+ self.LookupPublish("uStar3@COMPANY", "X", "x.x.y", "allow-log") -+ self.LookupPublish("uStar3@COMPANY", "X", "x.x.", "allow-log") -+ self.LookupPublish("uStar3@COMPANY", "X", "x.x", "deny-log") -+ self.LookupPublish("uStar3@COMPANY", "X", "q.x.y", "deny-log") -+ -+ # aclKey: "a.#.b" -+ self.LookupPublish("uHash1@COMPANY", "X", "a.b", "allow-log") -+ self.LookupPublish("uHash1@COMPANY", "X", "a.x.b", "allow-log") -+ self.LookupPublish("uHash1@COMPANY", "X", "a..x.y.zz.b", "allow-log") -+ self.LookupPublish("uHash1@COMPANY", "X", "a.b.", "deny-log") -+ self.LookupPublish("uHash1@COMPANY", "X", "q.x.b", "deny-log") -+ -+ # aclKey: "a.#" -+ self.LookupPublish("uHash2@COMPANY", "X", "a", "allow-log") -+ self.LookupPublish("uHash2@COMPANY", "X", "a.b", "allow-log") -+ self.LookupPublish("uHash2@COMPANY", "X", "a.b.c", "allow-log") -+ -+ # aclKey: "#.a" -+ self.LookupPublish("uHash3@COMPANY", "X", "a", "allow-log") -+ self.LookupPublish("uHash3@COMPANY", "X", "x.y.a", "allow-log") -+ -+ # aclKey: "a.#.b.#.c" -+ self.LookupPublish("uHash4@COMPANY", "X", "a.b.c", "allow-log") -+ self.LookupPublish("uHash4@COMPANY", "X", "a.x.b.y.c", "allow-log") -+ self.LookupPublish("uHash4@COMPANY", "X", "a.x.x.b.y.y.c", "allow-log") -+ -+ # aclKey: "*.x.#.y" -+ self.LookupPublish("uMixed1@COMPANY", "X", "a.x.y", "allow-log") -+ self.LookupPublish("uMixed1@COMPANY", "X", "a.x.p.qq.y", "allow-log") -+ self.LookupPublish("uMixed1@COMPANY", "X", "a.a.x.y", "deny-log") -+ self.LookupPublish("uMixed1@COMPANY", "X", "aa.x.b.c", "deny-log") -+ -+ # aclKey: "a.#.b.*" -+ self.LookupPublish("uMixed2@COMPANY", "X", "a.b.x", "allow-log") -+ self.LookupPublish("uMixed2@COMPANY", "X", "a.x.x.x.b.x", "allow-log") -+ -+ # aclKey: "*.*.*.#" -+ self.LookupPublish("uMixed3@COMPANY", "X", "x.y.z", "allow-log") -+ self.LookupPublish("uMixed3@COMPANY", "X", "x.y.z.a.b.c", "allow-log") -+ self.LookupPublish("uMixed3@COMPANY", "X", "x.y", "deny-log") -+ self.LookupPublish("uMixed3@COMPANY", "X", "x", "deny-log") -+ -+ # Repeat the keys with wildcard user spec -+ self.LookupPublish("uPlain1@COMPANY", "X", "MN.OP.Q", "allow-log") -+ self.LookupPublish("uStar1@COMPANY" , "X", "M.xx.N", "allow-log") -+ self.LookupPublish("uHash1@COMPANY" , "X", "M.N", "allow-log") -+ self.LookupPublish("uHash1@COMPANY" , "X", "M.x.N", "allow-log") -+ self.LookupPublish("uHash1@COMPANY" , "X", "M..x.y.zz.N", "allow-log") -+ self.LookupPublish("uMixed1@COMPANY", "X", "a.M.N", "allow-log") -+ self.LookupPublish("uMixed1@COMPANY", "X", "a.M.p.qq.N", "allow-log") -+ -+ self.LookupPublish("dev@QPID", "X", "MN.OP.Q", "allow-log") -+ self.LookupPublish("dev@QPID", "X", "M.xx.N", "allow-log") -+ self.LookupPublish("dev@QPID", "X", "M.N", "allow-log") -+ self.LookupPublish("dev@QPID", "X", "M.x.N", "allow-log") -+ self.LookupPublish("dev@QPID", "X", "M..x.y.zz.N", "allow-log") -+ self.LookupPublish("dev@QPID", "X", "a.M.N", "allow-log") -+ self.LookupPublish("dev@QPID", "X", "a.M.p.qq.N", "allow-log") -+ -+ #===================================== - # Connection limits - #===================================== - --- -1.7.1 - -From d9f282af80d57bdb01a90966178839da5cbf4021 Mon Sep 17 00:00:00 2001 -From: Charles E. Rolke -Date: Sun, 15 Jul 2012 11:52:47 -0500 -Subject: [PATCH 06/19] QPID-4107 r1361334 type in file name - -git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1361733 13f79535-47bb-0310-9956-ffa450edef68 - -Conflicts: - - qpid/cpp/src/ha.mk ---- - qpid/cpp/src/ha.mk | 2 +- - 1 files changed, 1 insertions(+), 1 deletions(-) - -diff --git a/qpid/cpp/src/ha.mk b/qpid/cpp/src/ha.mk -index 96a3d87..85dd9dd 100644 ---- a/qpid/cpp/src/ha.mk -+++ b/qpid/cpp/src/ha.mk -@@ -23,7 +23,7 @@ - dmoduleexec_LTLIBRARIES += ha.la - - ha_la_SOURCES = \ -- qpid/ha/AlternateExchangeSetter.h \ -+ qpid/ha/AlternateExchangeSetter.h \ - qpid/ha/Backup.cpp \ - qpid/ha/Backup.h \ - qpid/ha/BackupConnectionExcluder.h \ --- -1.7.1 - -From af60f8280c721dcee9b03b23bff4d89a9d61cf13 Mon Sep 17 00:00:00 2001 -From: Charles E. Rolke -Date: Mon, 16 Jul 2012 12:58:29 +0000 -Subject: [PATCH 07/19] QPID-3892 add missing file - -git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1362014 13f79535-47bb-0310-9956-ffa450edef68 ---- - qpid/cpp/src/qpid/acl/AclTopicMatch.h | 89 +++++++++++++++++++++++++++++++++ - 1 files changed, 89 insertions(+), 0 deletions(-) - create mode 100644 qpid/cpp/src/qpid/acl/AclTopicMatch.h - -diff --git a/qpid/cpp/src/qpid/acl/AclTopicMatch.h b/qpid/cpp/src/qpid/acl/AclTopicMatch.h -new file mode 100644 -index 0000000..486c229 ---- /dev/null -+++ b/qpid/cpp/src/qpid/acl/AclTopicMatch.h -@@ -0,0 +1,89 @@ -+#ifndef QPID_ACL_TOPIC_MATCH_H -+#define QPID_ACL_TOPIC_MATCH_H -+ -+/* -+ * -+ * Copyright (c) 2006 The Apache Software Foundation -+ * -+ * Licensed 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. -+ * -+ */ -+ -+#include "qpid/broker/TopicKeyNode.h" -+#include "qpid/broker/TopicExchange.h" -+#include "qpid/log/Statement.h" -+#include "boost/shared_ptr.hpp" -+#include -+#include -+ -+namespace qpid { -+namespace broker { -+ -+// Class for executing topic exchange routing key matching rules in -+// Acl code the allows or denies users publishing to an exchange. -+class TopicExchange::TopicExchangeTester { -+ -+class boundNode; -+ -+public: -+ typedef std::vector BindingVec; -+ typedef TopicKeyNode TestBindingNode; -+ -+private: -+ // Target class to be bound into topic key tree -+ class boundNode { -+ public: -+ BindingVec bindingVector; -+ }; -+ -+ // Acl binding trees contain only one node each. -+ // When the iterator sees it then the node matches the caller's spec. -+ class TestFinder : public TestBindingNode::TreeIterator { -+ public: -+ TestFinder(BindingVec& m) : bv(m), found(false) {}; -+ ~TestFinder() {}; -+ bool visit(TestBindingNode& /*node*/) { -+ assert(!found); -+ found = true; -+ return true; -+ } -+ BindingVec& bv; -+ bool found; -+ }; -+ -+public: -+ TopicExchangeTester() {}; -+ ~TopicExchangeTester() {}; -+ bool addBindingKey(const std::string& bKey) { -+ std::string routingPattern = normalize(bKey); -+ boundNode *mbn = bindingTree.add(routingPattern); -+ if (mbn) { -+ // push a dummy binding to mark this node as "non-leaf" -+ mbn->bindingVector.push_back(true); -+ return true; -+ } -+ return false; -+ } -+ -+ bool findMatches(const std::string& rKey, BindingVec& matches) { -+ TestFinder testFinder(matches); -+ bindingTree.iterateMatch( rKey, testFinder ); -+ return testFinder.found; -+ } -+ -+private: -+ TestBindingNode bindingTree; -+}; -+}} // namespace qpid::broker -+ -+#endif // QPID_ACL_TOPIC_MATCH_H --- -1.7.1 - -From c68822714d4da4bee808e19f4b10145b7f4bdcae Mon Sep 17 00:00:00 2001 -From: Charles E. Rolke -Date: Wed, 15 Aug 2012 14:14:57 +0000 -Subject: [PATCH 08/19] NO-JIRA Initialize variable before its use. - -git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1373429 13f79535-47bb-0310-9956-ffa450edef68 ---- - qpid/cpp/src/tests/acl.py | 1 + - 1 files changed, 1 insertions(+), 0 deletions(-) - -diff --git a/qpid/cpp/src/tests/acl.py b/qpid/cpp/src/tests/acl.py -index 0e096a6..23886d5 100755 ---- a/qpid/cpp/src/tests/acl.py -+++ b/qpid/cpp/src/tests/acl.py -@@ -119,6 +119,7 @@ class ACLTests(TestBase010): - def LookupPublish(self, userName, exchName, keyName, expectedResult): - result = self.acl_lookupPublish(userName, exchName, keyName) - if (result['result'] != expectedResult): -+ suffix = ', [ERROR: Expected= ' + expectedResult - if (result['result'] is None): - suffix = suffix + ', Exception= ' + result['text'] + ']' - else: --- -1.7.1 - -From 1a5a36a7d839c32d2e6edfe739de379624f3b3ba Mon Sep 17 00:00:00 2001 -From: Charles E. Rolke -Date: Mon, 20 Aug 2012 20:09:43 +0000 -Subject: [PATCH 09/19] QPID-4230 (review 6645) Username substition keywords in Acl file. - -git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1375195 13f79535-47bb-0310-9956-ffa450edef68 ---- - qpid/cpp/src/qpid/acl/AclData.cpp | 183 +++++++++++- - qpid/cpp/src/qpid/acl/AclData.h | 15 +- - qpid/cpp/src/qpid/acl/AclReader.cpp | 9 + - qpid/cpp/src/qpid/broker/AclModule.h | 4 +- - qpid/cpp/src/tests/acl.py | 540 ++++++++++++++++++++++++++++++++++ - 5 files changed, 738 insertions(+), 13 deletions(-) - -diff --git a/qpid/cpp/src/qpid/acl/AclData.cpp b/qpid/cpp/src/qpid/acl/AclData.cpp -index a07176d..7c14d09 100644 ---- a/qpid/cpp/src/qpid/acl/AclData.cpp -+++ b/qpid/cpp/src/qpid/acl/AclData.cpp -@@ -25,6 +25,13 @@ namespace qpid { - namespace acl { - - // -+ // Instantiate the substitution keyword string -+ // -+ const std::string AclData::USER_SUBSTITUTION_KEYWORD = "${user}"; -+ const std::string AclData::DOMAIN_SUBSTITUTION_KEYWORD = "${domain}"; -+ const std::string AclData::USERDOMAIN_SUBSTITUTION_KEYWORD = "${userdomain}"; -+ -+ // - // constructor - // - AclData::AclData(): -@@ -147,7 +154,17 @@ namespace acl { - // the calling args and not in the param map. - if (rulePropMapItr->first == acl::SPECPROP_NAME) - { -- if (matchProp(rulePropMapItr->second, name)) -+ // substitute user name into object name -+ bool result; -+ if (rsItr->ruleHasUserSub[PROP_NAME]) { -+ std::string sName(rulePropMapItr->second); -+ substituteUserId(sName, id); -+ result = matchProp(sName, name); -+ } else { -+ result = matchProp(rulePropMapItr->second, name); -+ } -+ -+ if (result) - { - QPID_LOG(debug, "ACL: lookup name '" << name - << "' matched with rule name '" -@@ -222,7 +239,20 @@ namespace acl { - break; - - default: -- if (matchProp(rulePropMapItr->second, lookupParamItr->second)) -+ bool result; -+ if ((SPECPROP_ALTERNATE == rulePropMapItr->first && rsItr->ruleHasUserSub[PROP_ALTERNATE]) || -+ (SPECPROP_ROUTINGKEY == rulePropMapItr->first && rsItr->ruleHasUserSub[PROP_ROUTINGKEY]) || -+ (SPECPROP_QUEUENAME == rulePropMapItr->first && rsItr->ruleHasUserSub[PROP_QUEUENAME])) -+ { -+ // These properties are allowed to have username substitution -+ std::string sName(rulePropMapItr->second); -+ substituteUserId(sName, id); -+ result = matchProp(sName, lookupParamItr->second); -+ } else { -+ result = matchProp(rulePropMapItr->second, lookupParamItr->second); -+ } -+ -+ if (result) - { - QPID_LOG(debug, "ACL: the pair(" - << AclHelper::getPropertyStr(lookupParamItr->first) -@@ -346,7 +376,18 @@ namespace acl { - bool match =true; - if (rsItr->pubExchNameInRule) - { -- if (matchProp(rsItr->pubExchName, name)) -+ // substitute user name into object name -+ bool result; -+ -+ if (rsItr->ruleHasUserSub[PROP_NAME]) { -+ std::string sName(rsItr->pubExchName); -+ substituteUserId(sName, id); -+ result = matchProp(sName, name); -+ } else { -+ result = matchProp(rsItr->pubExchName, name); -+ } -+ -+ if (result) - { - QPID_LOG(debug, "ACL: Rule: " << rsItr->rawRuleNum << " lookup exchange name '" - << name << "' matched with rule name '" -@@ -364,18 +405,40 @@ namespace acl { - - if (match && rsItr->pubRoutingKeyInRule) - { -- if (rsItr->matchRoutingKey(routingKey)) -+ if ((routingKey.find(USER_SUBSTITUTION_KEYWORD, 0) != std::string::npos) || -+ (routingKey.find(DOMAIN_SUBSTITUTION_KEYWORD, 0) != std::string::npos) || -+ (routingKey.find(USERDOMAIN_SUBSTITUTION_KEYWORD, 0) != std::string::npos)) - { -- QPID_LOG(debug, "ACL: Rule: " << rsItr->rawRuleNum << " lookup key name '" -- << routingKey << "' matched with rule routing key '" -- << rsItr->pubRoutingKey << "'"); -+ // The user is not allowed to present a routing key with the substitution key in it -+ QPID_LOG(debug, "ACL: Rule: " << rsItr->rawRuleNum << -+ " User-specified routing key has substitution wildcard:" << routingKey -+ << ". Rule match prohibited."); -+ match = false; - } - else - { -- QPID_LOG(debug, "ACL: Rule: " << rsItr->rawRuleNum << " lookup key name '" -- << routingKey << "' did not match with rule routing key '" -- << rsItr->pubRoutingKey << "'"); -- match = false; -+ bool result; -+ if (rsItr->ruleHasUserSub[PROP_ROUTINGKEY]) { -+ std::string sKey(routingKey); -+ substituteKeywords(sKey, id); -+ result = rsItr->matchRoutingKey(sKey); -+ } else { -+ result = rsItr->matchRoutingKey(routingKey); -+ } -+ -+ if (result) -+ { -+ QPID_LOG(debug, "ACL: Rule: " << rsItr->rawRuleNum << " lookup key name '" -+ << routingKey << "' matched with rule routing key '" -+ << rsItr->pubRoutingKey << "'"); -+ } -+ else -+ { -+ QPID_LOG(debug, "ACL: Rule: " << rsItr->rawRuleNum << " lookup key name '" -+ << routingKey << "' did not match with rule routing key '" -+ << rsItr->pubRoutingKey << "'"); -+ match = false; -+ } - } - } - -@@ -501,4 +564,102 @@ namespace acl { - return true; - } - -+ const std::string DOMAIN_SEPARATOR("@"); -+ const std::string PERIOD("."); -+ const std::string UNDERSCORE("_"); -+ // -+ // substituteString -+ // Given a name string from an Acl rule, substitute the replacement into it -+ // wherever the placeholder directs. -+ // -+ void AclData::substituteString(std::string& targetString, -+ const std::string& placeholder, -+ const std::string& replacement) -+ { -+ assert (!placeholder.empty()); -+ if (placeholder.empty()) -+ return; -+ size_t start_pos(0); -+ while((start_pos = targetString.find(placeholder, start_pos)) != std::string::npos) -+ { -+ targetString.replace(start_pos, placeholder.length(), replacement); -+ start_pos += replacement.length(); -+ } -+ } -+ -+ -+ // -+ // normalizeUserId -+ // Given a name string return it in a form usable as topic keys: -+ // change "@" and "." to "_". -+ // -+ std::string AclData::normalizeUserId(const std::string& userId) -+ { -+ std::string normalId(userId); -+ substituteString(normalId, DOMAIN_SEPARATOR, UNDERSCORE); -+ substituteString(normalId, PERIOD, UNDERSCORE); -+ return normalId; -+ } -+ -+ -+ // -+ // substituteUserId -+ // Given an Acl rule and an authenticated userId -+ // do the keyword substitutions on the rule. -+ // -+ void AclData::AclData::substituteUserId(std::string& ruleString, -+ const std::string& userId) -+ { -+ size_t locDomSeparator(0); -+ std::string user(""); -+ std::string domain(""); -+ std::string userdomain = normalizeUserId(userId); -+ -+ locDomSeparator = userId.find(DOMAIN_SEPARATOR); -+ if (std::string::npos == locDomSeparator) { -+ // "@" not found. There's just a user name -+ user = normalizeUserId(userId); -+ } else { -+ // "@" found, split the names. Domain may be blank. -+ user = normalizeUserId(userId.substr(0,locDomSeparator)); -+ domain = normalizeUserId(userId.substr(locDomSeparator+1)); -+ } -+ -+ substituteString(ruleString, USER_SUBSTITUTION_KEYWORD, user); -+ substituteString(ruleString, DOMAIN_SUBSTITUTION_KEYWORD, domain); -+ substituteString(ruleString, USERDOMAIN_SUBSTITUTION_KEYWORD, userdomain); -+ } -+ -+ -+ // -+ // substituteKeywords -+ // Given an Acl rule and an authenticated userId -+ // do reverse keyword substitutions on the rule. -+ // That is, replace the normalized name in the rule string with -+ // the keyword that represents it. This stragegy is used for -+ // topic key lookups where the keyword string proper is in the -+ // topic key search tree. -+ // -+ void AclData::AclData::substituteKeywords(std::string& ruleString, -+ const std::string& userId) -+ { -+ size_t locDomSeparator(0); -+ std::string user(""); -+ std::string domain(""); -+ std::string userdomain = normalizeUserId(userId); -+ -+ locDomSeparator = userId.find(DOMAIN_SEPARATOR); -+ if (std::string::npos == locDomSeparator) { -+ // "@" not found. There's just a user name -+ user = normalizeUserId(userId); -+ } else { -+ // "@" found, split the names -+ user = normalizeUserId(userId.substr(0,locDomSeparator)); -+ domain = normalizeUserId(userId.substr(locDomSeparator+1)); -+ } -+ std::string oRule(ruleString); -+ substituteString(ruleString, userdomain, USERDOMAIN_SUBSTITUTION_KEYWORD); -+ substituteString(ruleString, user, USER_SUBSTITUTION_KEYWORD); -+ substituteString(ruleString, domain, DOMAIN_SUBSTITUTION_KEYWORD); -+ } - }} -diff --git a/qpid/cpp/src/qpid/acl/AclData.h b/qpid/cpp/src/qpid/acl/AclData.h -index ca0a676..b4b13c4 100644 ---- a/qpid/cpp/src/qpid/acl/AclData.h -+++ b/qpid/cpp/src/qpid/acl/AclData.h -@@ -62,6 +62,7 @@ public: - boost::shared_ptr pTTest; - bool pubExchNameInRule; - std::string pubExchName; -+ std::vector ruleHasUserSub; - - Rule (int ruleNum, qpid::acl::AclResult res, specPropertyMap& p) : - rawRuleNum(ruleNum), -@@ -71,7 +72,8 @@ public: - pubRoutingKey(), - pTTest(boost::shared_ptr(new topicTester())), - pubExchNameInRule(false), -- pubExchName() -+ pubExchName(), -+ ruleHasUserSub(PROPERTYSIZE, false) - {} - - -@@ -132,6 +134,17 @@ public: - - bool matchProp(const std::string & src, const std::string& src1); - void clear (); -+ static const std::string USER_SUBSTITUTION_KEYWORD; -+ static const std::string DOMAIN_SUBSTITUTION_KEYWORD; -+ static const std::string USERDOMAIN_SUBSTITUTION_KEYWORD; -+ void substituteString(std::string& targetString, -+ const std::string& placeholder, -+ const std::string& replacement); -+ std::string normalizeUserId(const std::string& userId); -+ void substituteUserId(std::string& ruleString, -+ const std::string& userId); -+ void substituteKeywords(std::string& ruleString, -+ const std::string& userId); - - AclData(); - virtual ~AclData(); -diff --git a/qpid/cpp/src/qpid/acl/AclReader.cpp b/qpid/cpp/src/qpid/acl/AclReader.cpp -index f9be49b..fae67d0 100644 ---- a/qpid/cpp/src/qpid/acl/AclReader.cpp -+++ b/qpid/cpp/src/qpid/acl/AclReader.cpp -@@ -103,6 +103,15 @@ namespace acl { - } else { - AclData::Rule rule(cnt, (*i)->res, (*i)->props); - -+ // Record which properties have the user substitution string -+ for (pmCitr pItr=rule.props.begin(); pItr!=rule.props.end(); pItr++) { -+ if ((pItr->second.find(AclData::USER_SUBSTITUTION_KEYWORD, 0) != std::string::npos) || -+ (pItr->second.find(AclData::DOMAIN_SUBSTITUTION_KEYWORD, 0) != std::string::npos) || -+ (pItr->second.find(AclData::USERDOMAIN_SUBSTITUTION_KEYWORD, 0) != std::string::npos)) { -+ rule.ruleHasUserSub[pItr->first] = true; -+ } -+ } -+ - // Action -> Object -> map set > - std::ostringstream actionstr; - for (int acnt = ((*i)->actionAll ? 0 : (*i)->action); -diff --git a/qpid/cpp/src/qpid/broker/AclModule.h b/qpid/cpp/src/qpid/broker/AclModule.h -index f1eb0fc..4caf8ed 100644 ---- a/qpid/cpp/src/qpid/broker/AclModule.h -+++ b/qpid/cpp/src/qpid/broker/AclModule.h -@@ -78,7 +78,9 @@ namespace acl { - PROP_SCHEMACLASS, - PROP_POLICYTYPE, - PROP_MAXQUEUESIZE, -- PROP_MAXQUEUECOUNT }; -+ PROP_MAXQUEUECOUNT, -+ PROPERTYSIZE // PROPERTYSIZE must be last in list -+ }; - - // Property used in ACL spec file - // Note for properties common to file processing/rule storage and to -diff --git a/qpid/cpp/src/tests/acl.py b/qpid/cpp/src/tests/acl.py -index 23886d5..102796c 100755 ---- a/qpid/cpp/src/tests/acl.py -+++ b/qpid/cpp/src/tests/acl.py -@@ -1704,6 +1704,546 @@ class ACLTests(TestBase010): - result = None - - -+ #===================================== -+ # User name substitution -+ #===================================== -+ -+ def test_user_name_substitution(self): -+ """ -+ Test name substitution internals, limits, and edge cases. -+ """ -+ aclf = self.get_acl_file() -+ aclf.write('# begin hack alert: allow anonymous to access the lookup debug functions\n') -+ aclf.write('acl allow-log anonymous create queue\n') -+ aclf.write('acl allow-log anonymous all exchange name=qmf.*\n') -+ aclf.write('acl allow-log anonymous all exchange name=amq.direct\n') -+ aclf.write('acl allow-log anonymous all exchange name=qpid.management\n') -+ aclf.write('acl allow-log anonymous access method name=*\n') -+ aclf.write('# end hack alert\n') -+ aclf.write('acl allow all create queue name=tmp-${userdomain}\n') -+ aclf.write('acl allow all create queue name=${userdomain}-tmp\n') -+ aclf.write('acl allow all create queue name=tmp-${userdomain}-tmp\n') -+ aclf.write('acl allow all create queue name=tmp-${userdomain}-tmp-${userdomain}\n') -+ aclf.write('acl allow all create queue name=temp0-${userdomain}\n') -+ aclf.write('acl allow all access queue name=temp0-${userdomain}\n') -+ aclf.write('acl allow all purge queue name=temp0-${userdomain}\n') -+ aclf.write('acl allow all consume queue name=temp0-${userdomain}\n') -+ aclf.write('acl allow all delete queue name=temp0-${userdomain}\n') -+ aclf.write('acl allow all create exchange name=temp0-${userdomain}\n') -+ aclf.write('acl allow all access exchange name=temp0-${userdomain}\n') -+ aclf.write('acl allow all bind exchange name=temp0-${userdomain}\n') -+ aclf.write('acl allow all unbind exchange name=temp0-${userdomain}\n') -+ aclf.write('acl allow all delete exchange name=temp0-${userdomain}\n') -+ aclf.write('acl allow all publish exchange name=temp0-${userdomain}\n') -+ -+ aclf.write('acl allow all publish exchange name=X routingkey=${userdomain}.cd.e\n') -+ aclf.write('acl allow all publish exchange name=X routingkey=a.*.${userdomain}\n') -+ aclf.write('acl allow all publish exchange name=X routingkey=b.#.${userdomain}\n') -+ aclf.write('acl allow all publish exchange name=X routingkey=*.${userdomain}.#.y\n') -+ -+ aclf.write('acl allow all create queue name=user-${user}\n') -+ aclf.write('acl allow all publish exchange name=U routingkey=${user}.cd.e\n') -+ aclf.write('acl allow all publish exchange name=U routingkey=a.*.${user}\n') -+ aclf.write('acl allow all publish exchange name=U routingkey=b.#.${user}\n') -+ aclf.write('acl allow all publish exchange name=U routingkey=*.${user}.#.y\n') -+ -+ aclf.write('acl allow all create queue name=domain-${domain}\n') -+ aclf.write('acl allow all publish exchange name=D routingkey=${domain}.cd.e\n') -+ aclf.write('acl allow all publish exchange name=D routingkey=a.*.${domain}\n') -+ aclf.write('acl allow all publish exchange name=D routingkey=b.#.${domain}\n') -+ aclf.write('acl allow all publish exchange name=D routingkey=*.${domain}.#.y\n') -+ -+ # Resolving ${user}_${domain} into ${userdomain} works for everything but routing keys -+ aclf.write('acl allow all create queue name=mixed-OK-${user}_${domain}\n') -+ # For routing keys ${user}_${domain} will be parsed into ${userdomain}. -+ # Routing keys not be found when the rule specifies ${user}_${domain}. -+ aclf.write('acl allow all publish exchange name=NOGO routingkey=${user}_${domain}.cd.e\n') -+ # This works since it is does not conflict with ${userdomain} -+ aclf.write('acl allow all publish exchange name=OK routingkey=${user}___${domain}.cd.e\n') -+ -+ aclf.write('acl deny-log all all\n') -+ aclf.close() -+ -+ result = self.reload_acl() -+ if (result): -+ self.fail(result) -+ -+ self.Lookup("alice@QPID", "create", "queue", "tmp-alice_QPID", {}, "allow") -+ self.Lookup("bob@QPID", "create", "queue", "bob_QPID-tmp", {}, "allow") -+ self.Lookup("charlie@QPID", "create", "queue", "tmp-charlie_QPID-tmp", {}, "allow") -+ self.Lookup("dave@QPID", "create", "queue", "tmp-dave_QPID-tmp-dave_QPID", {}, "allow") -+ self.Lookup("ed@BIG.COM", "create", "queue", "tmp-ed_BIG_COM", {}, "allow") -+ self.Lookup("c.e.r@BIG.GER.COM", "create", "queue", "tmp-c_e_r_BIG_GER_COM", {}, "allow") -+ self.Lookup("c@", "create", "queue", "tmp-c_", {}, "allow") -+ self.Lookup("someuser", "create", "queue", "tmp-someuser", {}, "allow") -+ -+ self.Lookup("alice@QPID", "create", "queue", "tmp-${user}", {}, "deny-log") -+ -+ self.Lookup("bob@QPID", "create", "exchange", "temp0-bob_QPID", {}, "allow") -+ self.Lookup("bob@QPID", "access", "exchange", "temp0-bob_QPID", {}, "allow") -+ self.Lookup("bob@QPID", "bind", "exchange", "temp0-bob_QPID", {}, "allow") -+ self.Lookup("bob@QPID", "unbind", "exchange", "temp0-bob_QPID", {}, "allow") -+ self.Lookup("bob@QPID", "delete", "exchange", "temp0-bob_QPID", {}, "allow") -+ self.LookupPublish("bob@QPID", "temp0-bob_QPID", "x", "allow") -+ -+ self.Lookup("bob@QPID", "create", "queue", "temp0-bob_QPID", {}, "allow") -+ self.Lookup("bob@QPID", "access", "queue", "temp0-bob_QPID", {}, "allow") -+ self.Lookup("bob@QPID", "purge", "queue", "temp0-bob_QPID", {}, "allow") -+ self.Lookup("bob@QPID", "consume", "queue", "temp0-bob_QPID", {}, "allow") -+ self.Lookup("bob@QPID", "delete", "queue", "temp0-bob_QPID", {}, "allow") -+ -+ self.Lookup("alice@QPID", "access", "queue", "temp0-bob_QPID", {}, "deny-log") -+ -+ # aclKey: "${userdomain}.cd.e" -+ self.LookupPublish("uPlain1@COMPANY", "X", "uPlain1_COMPANY.cd.e", "allow") -+ # aclKey: "a.*.${userdomain}" -+ self.LookupPublish("uStar1@COMPANY", "X", "a.xx.uStar1_COMPANY", "allow") -+ self.LookupPublish("uStar1@COMPANY", "X", "a.b", "deny-log") -+ # aclKey: "b.#.${userdomain}" -+ self.LookupPublish("uHash1@COMPANY", "X", "b.uHash1_COMPANY", "allow") -+ self.LookupPublish("uHash1@COMPANY", "X", "b.x.uHash1_COMPANY", "allow") -+ self.LookupPublish("uHash1@COMPANY", "X", "b..x.y.zz.uHash1_COMPANY", "allow") -+ self.LookupPublish("uHash1@COMPANY", "X", "b.uHash1_COMPANY.", "deny-log") -+ self.LookupPublish("uHash1@COMPANY", "X", "q.x.uHash1_COMPANY", "deny-log") -+ # aclKey: "*.${userdomain}.#.y" -+ self.LookupPublish("uMixed1@COMPANY", "X", "a.uMixed1_COMPANY.y", "allow") -+ self.LookupPublish("uMixed1@COMPANY", "X", "a.uMixed1_COMPANY.p.qq.y", "allow") -+ self.LookupPublish("uMixed1@COMPANY", "X", "a.a.uMixed1_COMPANY.y", "deny-log") -+ self.LookupPublish("uMixed1@COMPANY", "X", "aa.uMixed1_COMPANY.b.c", "deny-log") -+ self.LookupPublish("uMixed1@COMPANY.COM", "X", "a.uMixed1_COMPANY_COM.y", "allow") -+ -+ -+ self.Lookup("bob@QPID", "create", "queue", "user-bob", {}, "allow") -+ # aclKey: "${user}.cd.e" -+ self.LookupPublish("uPlain1@COMPANY", "U", "uPlain1.cd.e", "allow") -+ # aclKey: "a.*.${user}" -+ self.LookupPublish("uStar1@COMPANY", "U", "a.xx.uStar1", "allow") -+ self.LookupPublish("uStar1@COMPANY", "U", "a.b", "deny-log") -+ # aclKey: "b.#.${user}" -+ self.LookupPublish("uHash1@COMPANY", "U", "b.uHash1", "allow") -+ self.LookupPublish("uHash1@COMPANY", "U", "b.x.uHash1", "allow") -+ self.LookupPublish("uHash1@COMPANY", "U", "b..x.y.zz.uHash1", "allow") -+ self.LookupPublish("uHash1@COMPANY", "U", "b.uHash1.", "deny-log") -+ self.LookupPublish("uHash1@COMPANY", "U", "q.x.uHash1", "deny-log") -+ # aclKey: "*.${user}.#.y" -+ self.LookupPublish("uMixed1@COMPANY", "U", "a.uMixed1.y", "allow") -+ self.LookupPublish("uMixed1@COMPANY", "U", "a.uMixed1.p.qq.y", "allow") -+ self.LookupPublish("uMixed1@COMPANY", "U", "a.a.uMixed1.y", "deny-log") -+ self.LookupPublish("uMixed1@COMPANY", "U", "aa.uMixed1.b.c", "deny-log") -+ self.LookupPublish("uMixed1@COMPANY.COM", "U", "a.uMixed1.y", "allow") -+ -+ -+ self.Lookup("bob@QPID", "create", "queue", "domain-QPID", {}, "allow") -+ # aclKey: "${domain}.cd.e" -+ self.LookupPublish("uPlain1@COMPANY", "D", "COMPANY.cd.e", "allow") -+ # aclKey: "a.*.${domain}" -+ self.LookupPublish("uStar1@COMPANY", "D", "a.xx.COMPANY", "allow") -+ self.LookupPublish("uStar1@COMPANY", "D", "a.b", "deny-log") -+ # aclKey: "b.#.${domain}" -+ self.LookupPublish("uHash1@COMPANY", "D", "b.COMPANY", "allow") -+ self.LookupPublish("uHash1@COMPANY", "D", "b.x.COMPANY", "allow") -+ self.LookupPublish("uHash1@COMPANY", "D", "b..x.y.zz.COMPANY", "allow") -+ self.LookupPublish("uHash1@COMPANY", "D", "b.COMPANY.", "deny-log") -+ self.LookupPublish("uHash1@COMPANY", "D", "q.x.COMPANY", "deny-log") -+ # aclKey: "*.${domain}.#.y" -+ self.LookupPublish("uMixed1@COMPANY", "D", "a.COMPANY.y", "allow") -+ self.LookupPublish("uMixed1@COMPANY", "D", "a.COMPANY.p.qq.y", "allow") -+ self.LookupPublish("uMixed1@COMPANY", "D", "a.a.COMPANY.y", "deny-log") -+ self.LookupPublish("uMixed1@COMPANY", "D", "aa.COMPANY.b.c", "deny-log") -+ self.LookupPublish("uMixed1@COMPANY.COM", "D", "a.COMPANY_COM.y", "allow") -+ -+ self.Lookup("uPlain1@COMPANY", "create", "queue", "mixed-OK-uPlain1_COMPANY", {}, "allow") -+ self.LookupPublish("uPlain1@COMPANY", "NOGO", "uPlain1_COMPANY.cd.e", "deny-log") -+ self.LookupPublish("uPlain1@COMPANY", "OK", "uPlain1___COMPANY.cd.e", "allow") -+ -+ -+ #===================================== -+ # User name substitution details -+ #===================================== -+ # User name substitution allows for three flavors of keyword in the Acl file. -+ # Given a user name of bob.user@QPID.COM the keywords are normalized and resolve as follows: -+ # ${userdomain} - bob_user_QPID_COM -+ # ${user} - bob_user -+ # ${domain} - QPID_COM -+ # -+ # The following substitution tests are very similar but differ in the flavor of keyword used -+ # in the rules. The tests results using the different keywords differ slightly in how permissive -+ # the rules become. -+ # ${userdomain} limits access to one authenticated user -+ # ${user} limits access to a user name regardless of user's domain -+ # ${domain} limits access to a domain regardless of user name -+ # -+ -+ def test_user_name_substitution_userdomain(self): -+ """ -+ Test a setup where users can create, bind, and publish to a main exchange and queue. -+ Allow access to a single alternate exchange and queue. -+ """ -+ aclf = self.get_acl_file() -+ aclf.write('# begin hack alert: allow anonymous to access the lookup debug functions\n') -+ aclf.write('acl allow-log anonymous create queue\n') -+ aclf.write('acl allow-log anonymous all exchange name=qmf.*\n') -+ aclf.write('acl allow-log anonymous all exchange name=amq.direct\n') -+ aclf.write('acl allow-log anonymous all exchange name=qpid.management\n') -+ aclf.write('acl allow-log anonymous access method name=*\n') -+ aclf.write('# end hack alert\n') -+ # Create primary queue and exchange: -+ # allow predefined alternate -+ # deny any other alternate -+ # allow no alternate -+ aclf.write('acl allow all create queue name=${userdomain}-work alternate=${userdomain}-work2\n') -+ aclf.write('acl deny all create queue name=${userdomain}-work alternate=*\n') -+ aclf.write('acl allow all create queue name=${userdomain}-work\n') -+ aclf.write('acl allow all create exchange name=${userdomain}-work alternate=${userdomain}-work2\n') -+ aclf.write('acl deny all create exchange name=${userdomain}-work alternate=*\n') -+ aclf.write('acl allow all create exchange name=${userdomain}-work\n') -+ # Create backup queue and exchange -+ # Deny any alternate -+ aclf.write('acl deny all create queue name=${userdomain}-work2 alternate=*\n') -+ aclf.write('acl allow all create queue name=${userdomain}-work2\n') -+ aclf.write('acl deny all create exchange name=${userdomain}-work2 alternate=*\n') -+ aclf.write('acl allow all create exchange name=${userdomain}-work2\n') -+ # Bind/unbind primary exchange -+ # Use only predefined routingkey and queuename -+ aclf.write('acl allow all bind exchange name=${userdomain}-work routingkey=${userdomain} queuename=${userdomain}-work\n') -+ aclf.write('acl allow all unbind exchange name=${userdomain}-work routingkey=${userdomain} queuename=${userdomain}-work\n') -+ # Bind/unbind backup exchange -+ # Use only predefined routingkey and queuename -+ aclf.write('acl allow all bind exchange name=${userdomain}-work2 routingkey=${userdomain} queuename=${userdomain}-work2\n') -+ aclf.write('acl allow all unbind exchange name=${userdomain}-work2 routingkey=${userdomain} queuename=${userdomain}-work2\n') -+ # Access primary exchange -+ # Use only predefined routingkey and queuename -+ aclf.write('acl allow all access exchange name=${userdomain}-work routingkey=${userdomain} queuename=${userdomain}-work\n') -+ # Access backup exchange -+ # Use only predefined routingkey and queuename -+ aclf.write('acl allow all access exchange name=${userdomain}-work2 routingkey=${userdomain} queuename=${userdomain}-work2\n') -+ # Publish primary exchange -+ # Use only predefined routingkey -+ aclf.write('acl allow all publish exchange name=${userdomain}-work routingkey=${userdomain}\n') -+ # Publish backup exchange -+ # Use only predefined routingkey -+ aclf.write('acl allow all publish exchange name=${userdomain}-work2 routingkey=${userdomain}\n') -+ # deny mode -+ aclf.write('acl deny all all\n') -+ aclf.close() -+ -+ result = self.reload_acl() -+ if (result): -+ self.fail(result) -+ -+ # create queues -+ self.Lookup("bob@QPID", "create", "queue", "bob_QPID-work", {}, "allow") -+ self.Lookup("bob@QPID", "create", "queue", "bob_QPID-work2", {}, "allow") -+ self.Lookup("bob@QPID", "create", "queue", "joe_QPID-work", {}, "deny") -+ self.Lookup("bob@QPID", "create", "queue", "joe_QPID-work2", {}, "deny") -+ self.Lookup("bob@QPID", "create", "queue", "bob_QPID-work3", {}, "deny") -+ self.Lookup("bob@QPID", "create", "queue", "bob_QPID-work", {"alternate":"bob_QPID-work2"}, "allow") -+ self.Lookup("bob@QPID", "create", "queue", "bob_QPID-work", {"alternate":"joe_QPID-work2"}, "deny") -+ self.Lookup("bob@QPID", "create", "queue", "bob_QPID-work2", {"alternate":"someexchange"}, "deny") -+ # create exchanges -+ self.Lookup("bob@QPID", "create", "exchange", "bob_QPID-work", {}, "allow") -+ self.Lookup("bob@QPID", "create", "exchange", "bob_QPID-work2",{}, "allow") -+ self.Lookup("bob@QPID", "create", "exchange", "joe_QPID-work", {}, "deny") -+ self.Lookup("bob@QPID", "create", "exchange", "joe_QPID-work2",{}, "deny") -+ self.Lookup("bob@QPID", "create", "exchange", "bob_QPID-work3",{}, "deny") -+ self.Lookup("bob@QPID", "create", "exchange", "bob_QPID-work", {"alternate":"bob_QPID-work2"}, "allow") -+ self.Lookup("bob@QPID", "create", "exchange", "bob_QPID-work2",{"alternate":"someexchange"}, "deny") -+ # bind/unbind/access -+ self.Lookup("bob@QPID", "bind", "exchange", "bob_QPID-work", {}, "deny") -+ self.Lookup("bob@QPID", "bind", "exchange", "bob_QPID-work", {"routingkey":"bob_QPID"}, "deny") -+ self.Lookup("bob@QPID", "bind", "exchange", "bob_QPID-work", { "queuename":"bob_QPID-work"}, "deny") -+ self.Lookup("bob@QPID", "bind", "exchange", "bob_QPID-work", {"routingkey":"bob_QPID", "queuename":"bob_QPID-work"}, "allow") -+ self.Lookup("bob@QPID", "bind", "exchange", "joe_QPID-work", {"routingkey":"bob_QPID", "queuename":"bob_QPID-work"}, "deny") -+ self.Lookup("bob@QPID", "bind", "exchange", "bob_QPID-work", {"routingkey":"joe_QPID", "queuename":"bob_QPID-work"}, "deny") -+ self.Lookup("bob@QPID", "bind", "exchange", "bob_QPID-work", {"routingkey":"bob_QPID", "queuename":"joe_QPID-work"}, "deny") -+ -+ self.Lookup("bob@QPID", "bind", "exchange", "bob_QPID-work2", {}, "deny") -+ self.Lookup("bob@QPID", "bind", "exchange", "bob_QPID-work2", {"routingkey":"bob_QPID"}, "deny") -+ self.Lookup("bob@QPID", "bind", "exchange", "bob_QPID-work2", { "queuename":"bob_QPID-work2"}, "deny") -+ self.Lookup("bob@QPID", "bind", "exchange", "bob_QPID-work2", {"routingkey":"bob_QPID", "queuename":"bob_QPID-work2"}, "allow") -+ self.Lookup("bob@QPID", "bind", "exchange", "joe_QPID-work2", {"routingkey":"bob_QPID", "queuename":"bob_QPID-work2"}, "deny") -+ self.Lookup("bob@QPID", "bind", "exchange", "bob_QPID-work2", {"routingkey":"joe_QPID", "queuename":"bob_QPID-work2"}, "deny") -+ self.Lookup("bob@QPID", "bind", "exchange", "bob_QPID-work2", {"routingkey":"bob_QPID", "queuename":"joe_QPID-work2"}, "deny") -+ -+ self.Lookup("bob@QPID", "unbind", "exchange", "bob_QPID-work", {}, "deny") -+ self.Lookup("bob@QPID", "unbind", "exchange", "bob_QPID-work", {"routingkey":"bob_QPID"}, "deny") -+ self.Lookup("bob@QPID", "unbind", "exchange", "bob_QPID-work", { "queuename":"bob_QPID-work"}, "deny") -+ self.Lookup("bob@QPID", "unbind", "exchange", "bob_QPID-work", {"routingkey":"bob_QPID", "queuename":"bob_QPID-work"}, "allow") -+ self.Lookup("bob@QPID", "unbind", "exchange", "joe_QPID-work", {"routingkey":"bob_QPID", "queuename":"bob_QPID-work"}, "deny") -+ self.Lookup("bob@QPID", "unbind", "exchange", "bob_QPID-work", {"routingkey":"joe_QPID", "queuename":"bob_QPID-work"}, "deny") -+ self.Lookup("bob@QPID", "unbind", "exchange", "bob_QPID-work", {"routingkey":"bob_QPID", "queuename":"joe_QPID-work"}, "deny") -+ -+ self.Lookup("bob@QPID", "unbind", "exchange", "bob_QPID-work2", {}, "deny") -+ self.Lookup("bob@QPID", "unbind", "exchange", "bob_QPID-work2", {"routingkey":"bob_QPID"}, "deny") -+ self.Lookup("bob@QPID", "unbind", "exchange", "bob_QPID-work2", { "queuename":"bob_QPID-work2"}, "deny") -+ self.Lookup("bob@QPID", "unbind", "exchange", "bob_QPID-work2", {"routingkey":"bob_QPID", "queuename":"bob_QPID-work2"}, "allow") -+ self.Lookup("bob@QPID", "unbind", "exchange", "joe_QPID-work2", {"routingkey":"bob_QPID", "queuename":"bob_QPID-work2"}, "deny") -+ self.Lookup("bob@QPID", "unbind", "exchange", "bob_QPID-work2", {"routingkey":"joe_QPID", "queuename":"bob_QPID-work2"}, "deny") -+ self.Lookup("bob@QPID", "unbind", "exchange", "bob_QPID-work2", {"routingkey":"bob_QPID", "queuename":"joe_QPID-work2"}, "deny") -+ -+ self.Lookup("bob@QPID", "access", "exchange", "bob_QPID-work", {}, "deny") -+ self.Lookup("bob@QPID", "access", "exchange", "bob_QPID-work", {"routingkey":"bob_QPID"}, "deny") -+ self.Lookup("bob@QPID", "access", "exchange", "bob_QPID-work", { "queuename":"bob_QPID-work"}, "deny") -+ self.Lookup("bob@QPID", "access", "exchange", "bob_QPID-work", {"routingkey":"bob_QPID", "queuename":"bob_QPID-work"}, "allow") -+ self.Lookup("bob@QPID", "access", "exchange", "joe_QPID-work", {"routingkey":"bob_QPID", "queuename":"bob_QPID-work"}, "deny") -+ self.Lookup("bob@QPID", "access", "exchange", "bob_QPID-work", {"routingkey":"joe_QPID", "queuename":"bob_QPID-work"}, "deny") -+ self.Lookup("bob@QPID", "access", "exchange", "bob_QPID-work", {"routingkey":"bob_QPID", "queuename":"joe_QPID-work"}, "deny") -+ -+ self.Lookup("bob@QPID", "access", "exchange", "bob_QPID-work2", {}, "deny") -+ self.Lookup("bob@QPID", "access", "exchange", "bob_QPID-work2", {"routingkey":"bob_QPID"}, "deny") -+ self.Lookup("bob@QPID", "access", "exchange", "bob_QPID-work2", { "queuename":"bob_QPID-work2"}, "deny") -+ self.Lookup("bob@QPID", "access", "exchange", "bob_QPID-work2", {"routingkey":"bob_QPID", "queuename":"bob_QPID-work2"}, "allow") -+ self.Lookup("bob@QPID", "access", "exchange", "joe_QPID-work2", {"routingkey":"bob_QPID", "queuename":"bob_QPID-work2"}, "deny") -+ self.Lookup("bob@QPID", "access", "exchange", "bob_QPID-work2", {"routingkey":"joe_QPID", "queuename":"bob_QPID-work2"}, "deny") -+ self.Lookup("bob@QPID", "access", "exchange", "bob_QPID-work2", {"routingkey":"bob_QPID", "queuename":"joe_QPID-work2"}, "deny") -+ # publish -+ self.LookupPublish("bob@QPID", "bob_QPID-work", "bob_QPID", "allow") -+ self.LookupPublish("bob@QPID", "bob_QPID-work2", "bob_QPID", "allow") -+ self.LookupPublish("bob@QPID", "joe_QPID-work", "bob_QPID", "deny") -+ self.LookupPublish("bob@QPID", "joe_QPID-work2", "bob_QPID", "deny") -+ self.LookupPublish("bob@QPID", "bob_QPID-work", "joe_QPID", "deny") -+ self.LookupPublish("bob@QPID", "bob_QPID-work2", "joe_QPID", "deny") -+ -+ -+ def test_user_name_substitution_user(self): -+ """ -+ Test a setup where users can create, bind, and publish to a main exchange and queue. -+ Allow access to a single backup exchange and queue. -+ """ -+ aclf = self.get_acl_file() -+ aclf.write('# begin hack alert: allow anonymous to access the lookup debug functions\n') -+ aclf.write('acl allow-log anonymous create queue\n') -+ aclf.write('acl allow-log anonymous all exchange name=qmf.*\n') -+ aclf.write('acl allow-log anonymous all exchange name=amq.direct\n') -+ aclf.write('acl allow-log anonymous all exchange name=qpid.management\n') -+ aclf.write('acl allow-log anonymous access method name=*\n') -+ aclf.write('# end hack alert\n') -+ # Create primary queue and exchange -+ # allow predefined alternate -+ # deny any other alternate -+ # allow no alternate -+ aclf.write('acl allow all create queue name=${user}-work alternate=${user}-work2\n') -+ aclf.write('acl deny all create queue name=${user}-work alternate=*\n') -+ aclf.write('acl allow all create queue name=${user}-work\n') -+ aclf.write('acl allow all create exchange name=${user}-work alternate=${user}-work2\n') -+ aclf.write('acl deny all create exchange name=${user}-work alternate=*\n') -+ aclf.write('acl allow all create exchange name=${user}-work\n') -+ # Create backup queue and exchange -+ # Deny any alternate -+ aclf.write('acl deny all create queue name=${user}-work2 alternate=*\n') -+ aclf.write('acl allow all create queue name=${user}-work2\n') -+ aclf.write('acl deny all create exchange name=${user}-work2 alternate=*\n') -+ aclf.write('acl allow all create exchange name=${user}-work2\n') -+ # Bind/unbind primary exchange -+ # Use only predefined routingkey and queuename -+ aclf.write('acl allow all bind exchange name=${user}-work routingkey=${user} queuename=${user}-work\n') -+ aclf.write('acl allow all unbind exchange name=${user}-work routingkey=${user} queuename=${user}-work\n') -+ # Bind/unbind backup exchange -+ # Use only predefined routingkey and queuename -+ aclf.write('acl allow all bind exchange name=${user}-work2 routingkey=${user} queuename=${user}-work2\n') -+ aclf.write('acl allow all unbind exchange name=${user}-work2 routingkey=${user} queuename=${user}-work2\n') -+ # Access primary exchange -+ # Use only predefined routingkey and queuename -+ aclf.write('acl allow all access exchange name=${user}-work routingkey=${user} queuename=${user}-work\n') -+ # Access backup exchange -+ # Use only predefined routingkey and queuename -+ aclf.write('acl allow all access exchange name=${user}-work2 routingkey=${user} queuename=${user}-work2\n') -+ # Publish primary exchange -+ # Use only predefined routingkey -+ aclf.write('acl allow all publish exchange name=${user}-work routingkey=${user}\n') -+ # Publish backup exchange -+ # Use only predefined routingkey -+ aclf.write('acl allow all publish exchange name=${user}-work2 routingkey=${user}\n') -+ # deny mode -+ aclf.write('acl deny all all\n') -+ aclf.close() -+ -+ result = self.reload_acl() -+ if (result): -+ self.fail(result) -+ -+ # create queues -+ self.Lookup("bob@QPID", "create", "queue", "bob-work", {}, "allow") -+ self.Lookup("bob@QPID", "create", "queue", "bob-work2", {}, "allow") -+ self.Lookup("bob@QPID", "create", "queue", "joe-work", {}, "deny") -+ self.Lookup("bob@QPID", "create", "queue", "joe-work2", {}, "deny") -+ self.Lookup("bob@QPID", "create", "queue", "bob-work3", {}, "deny") -+ self.Lookup("bob@QPID", "create", "queue", "bob-work", {"alternate":"bob-work2"}, "allow") -+ self.Lookup("bob@QPID", "create", "queue", "bob-work", {"alternate":"joe-work2"}, "deny") -+ self.Lookup("bob@QPID", "create", "queue", "bob-work2", {"alternate":"someexchange"},"deny") -+ # create exchanges -+ self.Lookup("bob@QPID", "create", "exchange", "bob-work", {}, "allow") -+ self.Lookup("bob@QPID", "create", "exchange", "bob-work2",{}, "allow") -+ self.Lookup("bob@QPID", "create", "exchange", "joe-work", {}, "deny") -+ self.Lookup("bob@QPID", "create", "exchange", "joe-work2",{}, "deny") -+ self.Lookup("bob@QPID", "create", "exchange", "bob-work3",{}, "deny") -+ self.Lookup("bob@QPID", "create", "exchange", "bob-work", {"alternate":"bob-work2"}, "allow") -+ self.Lookup("bob@QPID", "create", "exchange", "bob-work2",{"alternate":"someexchange"},"deny") -+ # bind/unbind/access -+ self.Lookup("bob@QPID", "bind", "exchange", "bob-work", {}, "deny") -+ self.Lookup("bob@QPID", "bind", "exchange", "bob-work", {"routingkey":"bob"}, "deny") -+ self.Lookup("bob@QPID", "bind", "exchange", "bob-work", { "queuename":"bob-work"}, "deny") -+ self.Lookup("bob@QPID", "bind", "exchange", "bob-work", {"routingkey":"bob", "queuename":"bob-work"}, "allow") -+ self.Lookup("bob@QPID", "bind", "exchange", "joe-work", {"routingkey":"bob", "queuename":"bob-work"}, "deny") -+ self.Lookup("bob@QPID", "bind", "exchange", "bob-work", {"routingkey":"joe", "queuename":"bob-work"}, "deny") -+ self.Lookup("bob@QPID", "bind", "exchange", "bob-work", {"routingkey":"bob", "queuename":"joe-work"}, "deny") -+ -+ self.Lookup("bob@QPID", "bind", "exchange", "bob-work2", {}, "deny") -+ self.Lookup("bob@QPID", "bind", "exchange", "bob-work2", {"routingkey":"bob"}, "deny") -+ self.Lookup("bob@QPID", "bind", "exchange", "bob-work2", { "queuename":"bob-work2"}, "deny") -+ self.Lookup("bob@QPID", "bind", "exchange", "bob-work2", {"routingkey":"bob", "queuename":"bob-work2"}, "allow") -+ self.Lookup("bob@QPID", "bind", "exchange", "joe-work2", {"routingkey":"bob", "queuename":"bob-work2"}, "deny") -+ self.Lookup("bob@QPID", "bind", "exchange", "bob-work2", {"routingkey":"joe", "queuename":"bob-work2"}, "deny") -+ self.Lookup("bob@QPID", "bind", "exchange", "bob-work2", {"routingkey":"bob", "queuename":"joe-work2"}, "deny") -+ -+ self.Lookup("bob@QPID", "unbind", "exchange", "bob-work", {}, "deny") -+ self.Lookup("bob@QPID", "unbind", "exchange", "bob-work", {"routingkey":"bob"}, "deny") -+ self.Lookup("bob@QPID", "unbind", "exchange", "bob-work", { "queuename":"bob-work"}, "deny") -+ self.Lookup("bob@QPID", "unbind", "exchange", "bob-work", {"routingkey":"bob", "queuename":"bob-work"}, "allow") -+ self.Lookup("bob@QPID", "unbind", "exchange", "joe-work", {"routingkey":"bob", "queuename":"bob-work"}, "deny") -+ self.Lookup("bob@QPID", "unbind", "exchange", "bob-work", {"routingkey":"joe", "queuename":"bob-work"}, "deny") -+ self.Lookup("bob@QPID", "unbind", "exchange", "bob-work", {"routingkey":"bob", "queuename":"joe-work"}, "deny") -+ -+ self.Lookup("bob@QPID", "unbind", "exchange", "bob-work2", {}, "deny") -+ self.Lookup("bob@QPID", "unbind", "exchange", "bob-work2", {"routingkey":"bob"}, "deny") -+ self.Lookup("bob@QPID", "unbind", "exchange", "bob-work2", { "queuename":"bob-work2"}, "deny") -+ self.Lookup("bob@QPID", "unbind", "exchange", "bob-work2", {"routingkey":"bob", "queuename":"bob-work2"}, "allow") -+ self.Lookup("bob@QPID", "unbind", "exchange", "joe-work2", {"routingkey":"bob", "queuename":"bob-work2"}, "deny") -+ self.Lookup("bob@QPID", "unbind", "exchange", "bob-work2", {"routingkey":"joe", "queuename":"bob-work2"}, "deny") -+ self.Lookup("bob@QPID", "unbind", "exchange", "bob-work2", {"routingkey":"bob", "queuename":"joe-work2"}, "deny") -+ -+ self.Lookup("bob@QPID", "access", "exchange", "bob-work", {}, "deny") -+ self.Lookup("bob@QPID", "access", "exchange", "bob-work", {"routingkey":"bob"}, "deny") -+ self.Lookup("bob@QPID", "access", "exchange", "bob-work", { "queuename":"bob-work"}, "deny") -+ self.Lookup("bob@QPID", "access", "exchange", "bob-work", {"routingkey":"bob", "queuename":"bob-work"}, "allow") -+ self.Lookup("bob@QPID", "access", "exchange", "joe-work", {"routingkey":"bob", "queuename":"bob-work"}, "deny") -+ self.Lookup("bob@QPID", "access", "exchange", "bob-work", {"routingkey":"joe", "queuename":"bob-work"}, "deny") -+ self.Lookup("bob@QPID", "access", "exchange", "bob-work", {"routingkey":"bob", "queuename":"joe-work"}, "deny") -+ -+ self.Lookup("bob@QPID", "access", "exchange", "bob-work2", {}, "deny") -+ self.Lookup("bob@QPID", "access", "exchange", "bob-work2", {"routingkey":"bob"}, "deny") -+ self.Lookup("bob@QPID", "access", "exchange", "bob-work2", { "queuename":"bob-work2"}, "deny") -+ self.Lookup("bob@QPID", "access", "exchange", "bob-work2", {"routingkey":"bob", "queuename":"bob-work2"}, "allow") -+ self.Lookup("bob@QPID", "access", "exchange", "joe-work2", {"routingkey":"bob", "queuename":"bob-work2"}, "deny") -+ self.Lookup("bob@QPID", "access", "exchange", "bob-work2", {"routingkey":"joe", "queuename":"bob-work2"}, "deny") -+ self.Lookup("bob@QPID", "access", "exchange", "bob-work2", {"routingkey":"bob", "queuename":"joe-work2"}, "deny") -+ # publish -+ self.LookupPublish("bob@QPID", "bob-work", "bob", "allow") -+ self.LookupPublish("bob@QPID", "bob-work2", "bob", "allow") -+ self.LookupPublish("bob@QPID", "joe-work", "bob", "deny") -+ self.LookupPublish("bob@QPID", "joe-work2", "bob", "deny") -+ self.LookupPublish("bob@QPID", "bob-work", "joe", "deny") -+ self.LookupPublish("bob@QPID", "bob-work2", "joe", "deny") -+ -+ -+ def test_user_name_substitution_domain(self): -+ """ -+ Test a setup where users can create, bind, and publish to a main exchange and queue. -+ Allow access to a single backup exchange and queue. -+ """ -+ aclf = self.get_acl_file() -+ aclf.write('# begin hack alert: allow anonymous to access the lookup debug functions\n') -+ aclf.write('acl allow-log anonymous create queue\n') -+ aclf.write('acl allow-log anonymous all exchange name=qmf.*\n') -+ aclf.write('acl allow-log anonymous all exchange name=amq.direct\n') -+ aclf.write('acl allow-log anonymous all exchange name=qpid.management\n') -+ aclf.write('acl allow-log anonymous access method name=*\n') -+ aclf.write('# end hack alert\n') -+ # Create primary queue and exchange -+ # allow predefined alternate -+ # deny any other alternate -+ # allow no alternate -+ aclf.write('acl allow all create queue name=${domain}-work alternate=${domain}-work2\n') -+ aclf.write('acl deny all create queue name=${domain}-work alternate=*\n') -+ aclf.write('acl allow all create queue name=${domain}-work\n') -+ aclf.write('acl allow all create exchange name=${domain}-work alternate=${domain}-work2\n') -+ aclf.write('acl deny all create exchange name=${domain}-work alternate=*\n') -+ aclf.write('acl allow all create exchange name=${domain}-work\n') -+ # Create backup queue and exchange -+ # Deny any alternate -+ aclf.write('acl deny all create queue name=${domain}-work2 alternate=*\n') -+ aclf.write('acl allow all create queue name=${domain}-work2\n') -+ aclf.write('acl deny all create exchange name=${domain}-work2 alternate=*\n') -+ aclf.write('acl allow all create exchange name=${domain}-work2\n') -+ # Bind/unbind primary exchange -+ # Use only predefined routingkey and queuename -+ aclf.write('acl allow all bind exchange name=${domain}-work routingkey=${domain} queuename=${domain}-work\n') -+ aclf.write('acl allow all unbind exchange name=${domain}-work routingkey=${domain} queuename=${domain}-work\n') -+ # Bind/unbind backup exchange -+ # Use only predefined routingkey and queuename -+ aclf.write('acl allow all bind exchange name=${domain}-work2 routingkey=${domain} queuename=${domain}-work2\n') -+ aclf.write('acl allow all unbind exchange name=${domain}-work2 routingkey=${domain} queuename=${domain}-work2\n') -+ # Access primary exchange -+ # Use only predefined routingkey and queuename -+ aclf.write('acl allow all access exchange name=${domain}-work routingkey=${domain} queuename=${domain}-work\n') -+ # Access backup exchange -+ # Use only predefined routingkey and queuename -+ aclf.write('acl allow all access exchange name=${domain}-work2 routingkey=${domain} queuename=${domain}-work2\n') -+ # Publish primary exchange -+ # Use only predefined routingkey -+ aclf.write('acl allow all publish exchange name=${domain}-work routingkey=${domain}\n') -+ # Publish backup exchange -+ # Use only predefined routingkey -+ aclf.write('acl allow all publish exchange name=${domain}-work2 routingkey=${domain}\n') -+ # deny mode -+ aclf.write('acl deny all all\n') -+ aclf.close() -+ -+ result = self.reload_acl() -+ if (result): -+ self.fail(result) -+ -+ # create queues -+ self.Lookup("bob@QPID", "create", "queue", "QPID-work", {}, "allow") -+ self.Lookup("bob@QPID", "create", "queue", "QPID-work2", {}, "allow") -+ self.Lookup("bob@QPID", "create", "queue", "QPID-work3", {}, "deny") -+ self.Lookup("bob@QPID", "create", "queue", "QPID-work", {"alternate":"QPID-work2"}, "allow") -+ self.Lookup("bob@QPID", "create", "queue", "QPID-work", {"alternate":"bob_QPID-work2"},"deny") -+ self.Lookup("bob@QPID", "create", "queue", "QPID-work", {"alternate":"joe_QPID-work2"},"deny") -+ self.Lookup("bob@QPID", "create", "queue", "QPID-work2", {"alternate":"someexchange"}, "deny") -+ # create exchanges -+ self.Lookup("bob@QPID", "create", "exchange", "QPID-work", {}, "allow") -+ self.Lookup("bob@QPID", "create", "exchange", "QPID-work2",{}, "allow") -+ self.Lookup("bob@QPID", "create", "exchange", "QPID-work3",{}, "deny") -+ self.Lookup("bob@QPID", "create", "exchange", "QPID-work", {"alternate":"QPID-work2"}, "allow") -+ self.Lookup("bob@QPID", "create", "exchange", "QPID-work2",{"alternate":"someexchange"}, "deny") -+ # bind/unbind/access -+ self.Lookup("bob@QPID", "bind", "exchange", "QPID-work", {}, "deny") -+ self.Lookup("bob@QPID", "bind", "exchange", "QPID-work", {"routingkey":"QPID"}, "deny") -+ self.Lookup("bob@QPID", "bind", "exchange", "QPID-work", { "queuename":"QPID-work"}, "deny") -+ self.Lookup("bob@QPID", "bind", "exchange", "QPID-work", {"routingkey":"QPID", "queuename":"QPID-work"}, "allow") -+ -+ self.Lookup("bob@QPID", "bind", "exchange", "QPID-work2", {}, "deny") -+ self.Lookup("bob@QPID", "bind", "exchange", "QPID-work2", {"routingkey":"QPID"}, "deny") -+ self.Lookup("bob@QPID", "bind", "exchange", "QPID-work2", { "queuename":"QPID-work2"}, "deny") -+ self.Lookup("bob@QPID", "bind", "exchange", "QPID-work2", {"routingkey":"QPID", "queuename":"QPID-work2"}, "allow") -+ -+ self.Lookup("bob@QPID", "unbind", "exchange", "QPID-work", {}, "deny") -+ self.Lookup("bob@QPID", "unbind", "exchange", "QPID-work", {"routingkey":"QPID"}, "deny") -+ self.Lookup("bob@QPID", "unbind", "exchange", "QPID-work", { "queuename":"QPID-work"}, "deny") -+ self.Lookup("bob@QPID", "unbind", "exchange", "QPID-work", {"routingkey":"QPID", "queuename":"QPID-work"}, "allow") -+ -+ self.Lookup("bob@QPID", "unbind", "exchange", "QPID-work2", {}, "deny") -+ self.Lookup("bob@QPID", "unbind", "exchange", "QPID-work2", {"routingkey":"QPID"}, "deny") -+ self.Lookup("bob@QPID", "unbind", "exchange", "QPID-work2", { "queuename":"QPID-work2"}, "deny") -+ self.Lookup("bob@QPID", "unbind", "exchange", "QPID-work2", {"routingkey":"QPID", "queuename":"QPID-work2"}, "allow") -+ -+ self.Lookup("bob@QPID", "access", "exchange", "QPID-work", {}, "deny") -+ self.Lookup("bob@QPID", "access", "exchange", "QPID-work", {"routingkey":"QPID"}, "deny") -+ self.Lookup("bob@QPID", "access", "exchange", "QPID-work", { "queuename":"QPID-work"}, "deny") -+ self.Lookup("bob@QPID", "access", "exchange", "QPID-work", {"routingkey":"QPID", "queuename":"QPID-work"}, "allow") -+ -+ self.Lookup("bob@QPID", "access", "exchange", "QPID-work2", {}, "deny") -+ self.Lookup("bob@QPID", "access", "exchange", "QPID-work2", {"routingkey":"QPID"}, "deny") -+ self.Lookup("bob@QPID", "access", "exchange", "QPID-work2", { "queuename":"QPID-work2"}, "deny") -+ self.Lookup("bob@QPID", "access", "exchange", "QPID-work2", {"routingkey":"QPID", "queuename":"QPID-work2"}, "allow") -+ # publish -+ self.LookupPublish("bob@QPID", "QPID-work", "QPID", "allow") -+ self.LookupPublish("bob@QPID", "QPID-work2", "QPID", "allow") -+ self.LookupPublish("joe@QPID", "QPID-work", "QPID", "allow") -+ self.LookupPublish("joe@QPID", "QPID-work2", "QPID", "allow") -+ -+ - class BrokerAdmin: - def __init__(self, broker, username=None, password=None): - self.connection = qpid.messaging.Connection(broker) --- -1.7.1 - -From dccba01e71e738e0e3789e062c712da7e6b9e7b3 Mon Sep 17 00:00:00 2001 -From: Charles E. Rolke -Date: Tue, 21 Aug 2012 14:42:51 +0000 -Subject: [PATCH 10/19] QPID-4230 Username substitution keywords in Acl file. Repair function definitions that fail Windows compile. - -git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1375583 13f79535-47bb-0310-9956-ffa450edef68 ---- - qpid/cpp/src/qpid/acl/AclData.cpp | 8 ++++---- - 1 files changed, 4 insertions(+), 4 deletions(-) - -diff --git a/qpid/cpp/src/qpid/acl/AclData.cpp b/qpid/cpp/src/qpid/acl/AclData.cpp -index 7c14d09..6994de2 100644 ---- a/qpid/cpp/src/qpid/acl/AclData.cpp -+++ b/qpid/cpp/src/qpid/acl/AclData.cpp -@@ -607,8 +607,8 @@ namespace acl { - // Given an Acl rule and an authenticated userId - // do the keyword substitutions on the rule. - // -- void AclData::AclData::substituteUserId(std::string& ruleString, -- const std::string& userId) -+ void AclData::substituteUserId(std::string& ruleString, -+ const std::string& userId) - { - size_t locDomSeparator(0); - std::string user(""); -@@ -640,8 +640,8 @@ namespace acl { - // topic key lookups where the keyword string proper is in the - // topic key search tree. - // -- void AclData::AclData::substituteKeywords(std::string& ruleString, -- const std::string& userId) -+ void AclData::substituteKeywords(std::string& ruleString, -+ const std::string& userId) - { - size_t locDomSeparator(0); - std::string user(""); --- -1.7.1 - -From 9133f1e58739093af5cdad674e0f2ee30c10188d Mon Sep 17 00:00:00 2001 -From: Chuck Rolke -Date: Mon, 20 Aug 2012 15:44:34 -0400 -Subject: [PATCH 11/19] This sort of works. It needs some refactoring. - ---- - qpid/cpp/src/qpid/acl/Acl.cpp | 14 +++- - qpid/cpp/src/qpid/acl/Acl.h | 5 +- - qpid/cpp/src/qpid/acl/AclConnectionCounter.cpp | 116 +++++++++++++++++++++--- - qpid/cpp/src/qpid/acl/AclConnectionCounter.h | 35 ++++++-- - qpid/cpp/src/qpid/acl/AclPlugin.cpp | 1 + - qpid/cpp/src/qpid/broker/AclModule.h | 5 + - qpid/cpp/src/qpid/broker/Broker.cpp | 5 + - qpid/cpp/src/tests/acl.py | 50 ++++++++++ - qpid/cpp/src/tests/run_acl_tests | 16 +++- - 9 files changed, 220 insertions(+), 27 deletions(-) - -diff --git a/qpid/cpp/src/qpid/acl/Acl.cpp b/qpid/cpp/src/qpid/acl/Acl.cpp -index 89c4b34..8116e67 100644 ---- a/qpid/cpp/src/qpid/acl/Acl.cpp -+++ b/qpid/cpp/src/qpid/acl/Acl.cpp -@@ -51,7 +51,7 @@ using qpid::management::Args; - namespace _qmf = qmf::org::apache::qpid::acl; - - Acl::Acl (AclValues& av, Broker& b): aclValues(av), broker(&b), transferAcl(false), mgmtObject(0), -- connectionCounter(new ConnectionCounter(*this, aclValues.aclMaxConnectPerUser, aclValues.aclMaxConnectPerIp, aclValues.aclMaxConnectTotal)) -+ connectionCounter(new ConnectionCounter(*this, aclValues.aclMaxConnectPerUser, aclValues.aclMaxConnectPerIp, aclValues.aclMaxConnectTotal, aclValues.aclMaxQueuesPerUser)) - { - - agent = broker->getManagementAgent(); -@@ -136,6 +136,18 @@ void Acl::setUserId(const qpid::broker::Connection& connection, const std::strin - } - - -+bool Acl::approveCreateQueue(const std::string& userId, const std::string& queueName) -+{ -+ return connectionCounter->approveCreateQueue(userId, queueName); -+} -+ -+ -+void Acl::recordDestroyQueue(const std::string& queueName) -+{ -+ connectionCounter->recordDestroyQueue(queueName); -+} -+ -+ - bool Acl::result( - const AclResult& aclreslt, - const std::string& id, -diff --git a/qpid/cpp/src/qpid/acl/Acl.h b/qpid/cpp/src/qpid/acl/Acl.h -index 4787934..918b98c 100644 ---- a/qpid/cpp/src/qpid/acl/Acl.h -+++ b/qpid/cpp/src/qpid/acl/Acl.h -@@ -49,6 +49,7 @@ struct AclValues { - uint16_t aclMaxConnectPerUser; - uint16_t aclMaxConnectPerIp; - uint16_t aclMaxConnectTotal; -+ uint16_t aclMaxQueuesPerUser; - }; - - -@@ -92,9 +93,11 @@ public: - const std::string& ExchangeName, - const std::string& RoutingKey); - -+ // Resource quota tracking - virtual bool approveConnection(const broker::Connection& connection); -- - virtual void setUserId(const broker::Connection& connection, const std::string& username); -+ virtual bool approveCreateQueue(const std::string& userId, const std::string& queueName); -+ virtual void recordDestroyQueue(const std::string& queueName); - - virtual ~Acl(); - private: -diff --git a/qpid/cpp/src/qpid/acl/AclConnectionCounter.cpp b/qpid/cpp/src/qpid/acl/AclConnectionCounter.cpp -index 8c6e3ee..56dbced 100644 ---- a/qpid/cpp/src/qpid/acl/AclConnectionCounter.cpp -+++ b/qpid/cpp/src/qpid/acl/AclConnectionCounter.cpp -@@ -42,8 +42,10 @@ namespace acl { - // - // - // --ConnectionCounter::ConnectionCounter(Acl& a, uint16_t nl, uint16_t hl, uint16_t tl) : -- acl(a), nameLimit(nl), hostLimit(hl), totalLimit(tl), totalCurrentConnections(0) {} -+ConnectionCounter::ConnectionCounter(Acl& a, uint16_t nl, uint16_t hl, uint16_t tl, uint16_t ql) : -+ acl(a), nameLimit(nl), hostLimit(hl), totalLimit(tl), queueLimit(ql), totalCurrentConnections(0) { -+ QPID_LOG(critical, "ACL CONNECTION_COUNTER nameLimit:" << nameLimit << ", hostLimit:" << hostLimit << ", totalLimit:" << totalLimit << ", queueLimit:" << queueLimit); -+ } - - ConnectionCounter::~ConnectionCounter() {} - -@@ -55,7 +57,7 @@ ConnectionCounter::~ConnectionCounter() {} - // Called with lock held. - // - bool ConnectionCounter::limitApproveLH( -- connectCountsMap_t& theMap, -+ countsMap_t& theMap, - const std::string& theName, - uint16_t theLimit, - bool emitLog) { -@@ -63,7 +65,7 @@ bool ConnectionCounter::limitApproveLH( - bool result(true); - if (theLimit > 0) { - uint16_t count; -- connectCountsMap_t::iterator eRef = theMap.find(theName); -+ countsMap_t::iterator eRef = theMap.find(theName); - if (eRef != theMap.end()) { - count = (uint16_t)(*eRef).second; - result = count <= theLimit; -@@ -73,9 +75,49 @@ bool ConnectionCounter::limitApproveLH( - } - if (emitLog) { - QPID_LOG(trace, "ACL ConnectionApprover IP=" << theName -- << " limit=" << theLimit -- << " curValue=" << count -- << " result=" << (result ? "allow" : "deny")); -+ << " limit=" << theLimit -+ << " curValue=" << count -+ << " result=" << (result ? "allow" : "deny")); -+ } -+ } -+ return result; -+} -+ -+ -+// -+// limitApproveLH -+// -+// Resource creation approver. -+// If user is under limit increment count and return true. -+// Called with lock held. -+// -+bool ConnectionCounter::limitApproveLH( -+ const std::string& theTitle, -+ countsMap_t& theMap, -+ const std::string& theName, -+ uint16_t theLimit, -+ bool emitLog) { -+ -+ bool result(true); -+ if (theLimit > 0) { -+ uint16_t count; -+ countsMap_t::iterator eRef = theMap.find(theName); -+ if (eRef != theMap.end()) { -+ count = (uint16_t)(*eRef).second; -+ result = count < theLimit; -+ if (result) { -+ count += 1; -+ (*eRef).second = count; -+ } -+ } else { -+ // Not found -+ theMap[theName] = count = 1; -+ } -+ if (emitLog) { -+ QPID_LOG(trace, theTitle << theName -+ << " limit=" << theLimit -+ << " curValue=" << count -+ << " result=" << (result ? "allow" : "deny")); - } - } - return result; -@@ -89,7 +131,7 @@ bool ConnectionCounter::limitApproveLH( - // called with dataLock already taken - // - bool ConnectionCounter::countConnectionLH( -- connectCountsMap_t& theMap, -+ countsMap_t& theMap, - const std::string& theName, - uint16_t theLimit, - bool emitLog) { -@@ -97,7 +139,7 @@ bool ConnectionCounter::countConnectionLH( - bool result(true); - uint16_t count(0); - if (theLimit > 0) { -- connectCountsMap_t::iterator eRef = theMap.find(theName); -+ countsMap_t::iterator eRef = theMap.find(theName); - if (eRef != theMap.end()) { - count = (uint16_t)(*eRef).second + 1; - (*eRef).second = count; -@@ -123,10 +165,10 @@ bool ConnectionCounter::countConnectionLH( - // called with dataLock already taken - // - void ConnectionCounter::releaseLH( -- connectCountsMap_t& theMap, const std::string& theName, uint16_t theLimit) { -+ countsMap_t& theMap, const std::string& theName, uint16_t theLimit) { - - if (theLimit > 0) { -- connectCountsMap_t::iterator eRef = theMap.find(theName); -+ countsMap_t::iterator eRef = theMap.find(theName); - if (eRef != theMap.end()) { - uint16_t count = (uint16_t) (*eRef).second; - assert (count > 0); -@@ -174,7 +216,7 @@ void ConnectionCounter::closed(broker::Connection& connection) { - - Mutex::ScopedLock locker(dataLock); - -- connectCountsMap_t::iterator eRef = connectProgressMap.find(connection.getMgmtId()); -+ countsMap_t::iterator eRef = connectProgressMap.find(connection.getMgmtId()); - if (eRef != connectProgressMap.end()) { - if ((*eRef).second == C_OPENED){ - // Normal case: connection was created and opened. -@@ -306,7 +348,7 @@ void ConnectionCounter::setUserId(const broker::Connection& connection, - { - Mutex::ScopedLock locker(dataLock); - -- connectCountsMap_t::iterator eRef = connectProgressMap.find(connection.getMgmtId()); -+ countsMap_t::iterator eRef = connectProgressMap.find(connection.getMgmtId()); - if (eRef != connectProgressMap.end()) { - if ((*eRef).second == C_OPENED){ - // Connection has been opened so that current user has been counted -@@ -338,6 +380,54 @@ void ConnectionCounter::setUserId(const broker::Connection& connection, - - - // -+// approveCreateQueue -+// Count an attempted queue creation by this user. -+// Disapprove if over limit. -+// -+bool ConnectionCounter::approveCreateQueue(const std::string& userId, const std::string& queueName) -+{ -+ Mutex::ScopedLock locker(dataLock); -+ -+ QPID_LOG(critical, "approveCreateQueue ----------- userId:" << userId << ", queueName:" << queueName); -+ -+ bool okByQ = limitApproveLH("ACL Queue creation approver. userId:", queuePerUserMap, userId, queueLimit, true); -+ -+ if (okByQ) { -+ // Queue is owned by this userId -+ queueOwnerMap[queueName] = userId; -+ -+ QPID_LOG(trace, "ACL create queue approved for user '" << userId -+ << "' queue '" << queueName << "'"); -+ } else { -+ -+ QPID_LOG(error, "Client max queue count limit of " << queueLimit -+ << " exceeded by '" << userId << "' creating queue '" -+ << queueName << "'. Queue creation denied."); -+ } -+ return okByQ; -+} -+ -+ -+// -+// recordDestroyQueue -+// Return a destroyed queue to a user's quota -+// -+void ConnectionCounter::recordDestroyQueue(const std::string& queueName) -+{ -+ Mutex::ScopedLock locker(dataLock); -+ -+ queueOwnerMap_t::iterator eRef = queueOwnerMap.find(queueName); -+ if (eRef != queueOwnerMap.end()) { -+ releaseLH(queuePerUserMap, (*eRef).second, queueLimit); -+ -+ queueOwnerMap.erase(eRef); -+ } else { -+ QPID_LOG(notice, "ACL owner for queue '" << queueName -+ << "' not found in owner map"); -+ } -+} -+ -+// - // getClientIp - given a connection's mgmtId return the client host part. - // - // TODO: Ideally this would be a method of the connection itself. -diff --git a/qpid/cpp/src/qpid/acl/AclConnectionCounter.h b/qpid/cpp/src/qpid/acl/AclConnectionCounter.h -index 54fa693..70c60fb 100644 ---- a/qpid/cpp/src/qpid/acl/AclConnectionCounter.h -+++ b/qpid/cpp/src/qpid/acl/AclConnectionCounter.h -@@ -44,48 +44,63 @@ class Acl; - class ConnectionCounter : public broker::ConnectionObserver - { - private: -- typedef std::map connectCountsMap_t; -+ typedef std::map countsMap_t; - enum CONNECTION_PROGRESS { C_CREATED=1, C_OPENED=2 }; -+ typedef std::map queueOwnerMap_t; - - Acl& acl; - uint16_t nameLimit; - uint16_t hostLimit; - uint16_t totalLimit; -+ uint16_t queueLimit; - uint16_t totalCurrentConnections; - qpid::sys::Mutex dataLock; - - /** Records per-connection state */ -- connectCountsMap_t connectProgressMap; -+ countsMap_t connectProgressMap; - - /** Records per-username counts */ -- connectCountsMap_t connectByNameMap; -+ countsMap_t connectByNameMap; - - /** Records per-host counts */ -- connectCountsMap_t connectByHostMap; -+ countsMap_t connectByHostMap; -+ -+ /** Records queueName-queueUserId */ -+ queueOwnerMap_t queueOwnerMap; -+ -+ /** Records queue-by-owner counts */ -+ countsMap_t queuePerUserMap; - - /** Given a connection's management ID, return the client host name */ - std::string getClientHost(const std::string mgmtId); - - /** Return approval for proposed connection */ -- bool limitApproveLH(connectCountsMap_t& theMap, -+ bool limitApproveLH(countsMap_t& theMap, -+ const std::string& theName, -+ uint16_t theLimit, -+ bool emitLog); -+ -+ /** Return approval for proposed resource creation */ -+ bool limitApproveLH(const std::string& theTitle, -+ countsMap_t& theMap, - const std::string& theName, - uint16_t theLimit, - bool emitLog); - - /** Record a connection. - * @return indication if user/host is over its limit */ -- bool countConnectionLH(connectCountsMap_t& theMap, -+ bool countConnectionLH(countsMap_t& theMap, - const std::string& theName, - uint16_t theLimit, - bool emitLog); - - /** Release a connection */ -- void releaseLH(connectCountsMap_t& theMap, -+ void releaseLH(countsMap_t& theMap, - const std::string& theName, - uint16_t theLimit); - - public: -- ConnectionCounter(Acl& acl, uint16_t nl, uint16_t hl, uint16_t tl); -+ ConnectionCounter(Acl& acl, uint16_t nl, uint16_t hl, uint16_t tl, uint16_t ql); - ~ConnectionCounter(); - - // ConnectionObserver interface -@@ -95,6 +110,10 @@ public: - // Connection counting - bool approveConnection(const broker::Connection& conn); - void setUserId(const broker::Connection& connection, const std::string& username); -+ -+ // Queue counting -+ bool approveCreateQueue(const std::string& userId, const std::string& queueName); -+ void recordDestroyQueue(const std::string& queueName); - }; - - }} // namespace qpid::ha -diff --git a/qpid/cpp/src/qpid/acl/AclPlugin.cpp b/qpid/cpp/src/qpid/acl/AclPlugin.cpp -index ebf5e90..4aaa00a 100644 ---- a/qpid/cpp/src/qpid/acl/AclPlugin.cpp -+++ b/qpid/cpp/src/qpid/acl/AclPlugin.cpp -@@ -45,6 +45,7 @@ struct AclOptions : public Options { - ("max-connections" , optValue(values.aclMaxConnectTotal, "N"), "The maximum combined number of connections allowed. 0 implies no limit.") - ("max-connections-per-user", optValue(values.aclMaxConnectPerUser, "N"), "The maximum number of connections allowed per user. 0 implies no limit.") - ("max-connections-per-ip" , optValue(values.aclMaxConnectPerIp, "N"), "The maximum number of connections allowed per host IP address. 0 implies no limit.") -+ ("max-queues-per-user", optValue(values.aclMaxQueuesPerUser, "N"), "The maximum number of queues allowed per user. 0 implies no limit.") - ; - } - }; -diff --git a/qpid/cpp/src/qpid/broker/AclModule.h b/qpid/cpp/src/qpid/broker/AclModule.h -index 4caf8ed..987d3e4 100644 ---- a/qpid/cpp/src/qpid/broker/AclModule.h -+++ b/qpid/cpp/src/qpid/broker/AclModule.h -@@ -151,6 +151,11 @@ namespace broker { - */ - virtual void setUserId(const Connection& connection, const std::string& username)=0; - -+ /** Approve queue creation by counting per-user. -+ */ -+ virtual bool approveCreateQueue(const std::string& userId, const std::string& queueName)=0; -+ virtual void recordDestroyQueue(const std::string& queueName)=0; -+ - virtual ~AclModule() {}; - }; - } // namespace broker -diff --git a/qpid/cpp/src/qpid/broker/Broker.cpp b/qpid/cpp/src/qpid/broker/Broker.cpp -index c202d9c..be7340a 100644 ---- a/qpid/cpp/src/qpid/broker/Broker.cpp -+++ b/qpid/cpp/src/qpid/broker/Broker.cpp -@@ -1076,6 +1076,9 @@ std::pair, bool> Broker::createQueue( - - if (!acl->authorise(userId,acl::ACT_CREATE,acl::OBJ_QUEUE,name,¶ms) ) - throw framing::UnauthorizedAccessException(QPID_MSG("ACL denied queue create request from " << userId)); -+ -+ if (!acl->approveCreateQueue(userId,name) ) -+ throw framing::UnauthorizedAccessException(QPID_MSG("ACL denied queue create request from " << userId)); - } - - Exchange::shared_ptr alternate; -@@ -1113,6 +1116,8 @@ void Broker::deleteQueue(const std::string& name, const std::string& userId, - Queue::shared_ptr queue = queues.find(name); - if (queue) { - if (check) check(queue); -+ if (acl) -+ acl->recordDestroyQueue(name); - queues.destroy(name); - queue->destroyed(); - } else { -diff --git a/qpid/cpp/src/tests/acl.py b/qpid/cpp/src/tests/acl.py -index 102796c..8055996 100755 ---- a/qpid/cpp/src/tests/acl.py -+++ b/qpid/cpp/src/tests/acl.py -@@ -53,6 +53,9 @@ class ACLTests(TestBase010): - def port_u(self): - return int(self.defines["port-u"]) - -+ def port_q(self): -+ return int(self.defines["port-q"]) -+ - def get_session_by_port(self, user, passwd, byPort): - socket = connect(self.broker.host, byPort) - connection = Connection (sock=socket, username=user, password=passwd, -@@ -2243,6 +2246,53 @@ class ACLTests(TestBase010): - self.LookupPublish("joe@QPID", "QPID-work", "QPID", "allow") - self.LookupPublish("joe@QPID", "QPID-work2", "QPID", "allow") - -+ #===================================== -+ # Queue limits -+ #===================================== -+ -+ def test__queue_limits(self): -+ """ -+ Test ACL control queue limits -+ """ -+ # bob should be able to create two queues -+ session = self.get_session_by_port('bob','bob', self.port_q()) -+ -+ try: -+ session.queue_declare(queue="queue1") -+ session.queue_declare(queue="queue2") -+ except qpid.session.SessionException, e: -+ self.fail("Error during queue create request"); -+ -+ # third queue should fail -+ try: -+ session.queue_declare(queue="queue3") -+ self.fail("Should not be able to create third queue") -+ except Exception, e: -+ result = None -+ session = self.get_session_by_port('bob','bob', self.port_q()) -+ -+ # alice should be able to create two queues -+ session2 = self.get_session_by_port('alice','alice', self.port_q()) -+ -+ try: -+ session2.queue_declare(queue="queuea1") -+ session2.queue_declare(queue="queuea2") -+ except qpid.session.SessionException, e: -+ self.fail("Error during queue create request"); -+ -+ # third queue should fail -+ try: -+ session2.queue_declare(queue="queuea3") -+ self.fail("Should not be able to create third queue") -+ except Exception, e: -+ result = None -+ -+ # bob should be able to delete a queue and create another -+ try: -+ session.queue_delete(queue="queue1") -+ session.queue_declare(queue="queue3") -+ except qpid.session.SessionException, e: -+ self.fail("Error during queue create request"); - - class BrokerAdmin: - def __init__(self, broker, username=None, password=None): -diff --git a/qpid/cpp/src/tests/run_acl_tests b/qpid/cpp/src/tests/run_acl_tests -index 25241ad..652684f 100755 ---- a/qpid/cpp/src/tests/run_acl_tests -+++ b/qpid/cpp/src/tests/run_acl_tests -@@ -24,22 +24,26 @@ source ./test_env.sh - DATA_DIR=`pwd`/data_dir - DATA_DIRI=`pwd`/data_diri - DATA_DIRU=`pwd`/data_diru -+DATA_DIRQ=`pwd`/data_dirq - - trap stop_brokers INT TERM QUIT - - start_brokers() { -- ../qpidd --daemon --port 0 --no-module-dir --data-dir $DATA_DIR --load-module $ACL_LIB --acl-file policy.acl --auth no --log-to-file local.log > qpidd.port -+ ../qpidd --daemon --port 0 --no-module-dir --data-dir $DATA_DIR --load-module $ACL_LIB --acl-file policy.acl --auth no --log-to-file local.log > qpidd.port - LOCAL_PORT=`cat qpidd.port` -- ../qpidd --daemon --port 0 --no-module-dir --data-dir $DATA_DIRI --load-module $ACL_LIB --acl-file policy.acl --auth no --max-connections-per-ip 2 --log-to-file locali.log > qpiddi.port -+ ../qpidd --daemon --port 0 --no-module-dir --data-dir $DATA_DIRI --load-module $ACL_LIB --acl-file policy.acl --auth no --max-connections-per-ip 2 --log-to-file locali.log > qpiddi.port - LOCAL_PORTI=`cat qpiddi.port` - ../qpidd --daemon --port 0 --no-module-dir --data-dir $DATA_DIRU --load-module $ACL_LIB --acl-file policy.acl --auth no --max-connections-per-user 2 --log-to-file localu.log > qpiddu.port - LOCAL_PORTU=`cat qpiddu.port` -+ ../qpidd --daemon --port 0 --no-module-dir --data-dir $DATA_DIRQ --load-module $ACL_LIB --acl-file policy.acl --auth no --max-queues-per-user 2 -t --log-to-file localq.log > qpiddq.port -+ LOCAL_PORTQ=`cat qpiddq.port` - } - - stop_brokers() { - $QPIDD_EXEC --no-module-dir -q --port $LOCAL_PORT - $QPIDD_EXEC --no-module-dir -q --port $LOCAL_PORTI - $QPIDD_EXEC --no-module-dir -q --port $LOCAL_PORTU -+ $QPIDD_EXEC --no-module-dir -q --port $LOCAL_PORTQ - } - - test_loading_acl_from_absolute_path(){ -@@ -59,20 +63,24 @@ if test -d ${PYTHON_DIR} ; then - rm -rf $DATA_DIR - rm -rf $DATA_DIRI - rm -rf $DATA_DIRU -+ rm -rf $DATA_DIRQ - mkdir -p $DATA_DIR - mkdir -p $DATA_DIRI - mkdir -p $DATA_DIRU -+ mkdir -p $DATA_DIRQ - cp $srcdir/policy.acl $DATA_DIR - cp $srcdir/policy.acl $DATA_DIRI - cp $srcdir/policy.acl $DATA_DIRU -+ cp $srcdir/policy.acl $DATA_DIRQ - start_brokers -- echo "Running acl tests using brokers on ports $LOCAL_PORT, $LOCAL_PORTI, and $LOCAL_PORTU" -- $QPID_PYTHON_TEST -b localhost:$LOCAL_PORT -m acl -Dport-i=$LOCAL_PORTI -Dport-u=$LOCAL_PORTU || EXITCODE=1 -+ echo "Running acl tests using brokers on ports $LOCAL_PORT, $LOCAL_PORTI, $LOCAL_PORTU, and $LOCAL_PORTQ" -+ $QPID_PYTHON_TEST -b localhost:$LOCAL_PORT -m acl -Dport-i=$LOCAL_PORTI -Dport-u=$LOCAL_PORTU -Dport-q=$LOCAL_PORTQ || EXITCODE=1 - stop_brokers || EXITCODE=1 - test_loading_acl_from_absolute_path || EXITCODE=1 - rm -rf $DATA_DIR - rm -rf $DATA_DIRI - rm -rf $DATA_DIRU -+ rm -rf $DATA_DIRQ - exit $EXITCODE - fi - --- -1.7.1 - -From 423d492e38f4214a2ca1d87f0ee7347203785fef Mon Sep 17 00:00:00 2001 -From: Chuck Rolke -Date: Tue, 21 Aug 2012 15:21:26 -0400 -Subject: [PATCH 12/19] QPID-2393 Count queues per user. - Move queue counting functions out of connection counting files - and into new files. - ---- - qpid/cpp/src/qpid/acl/AclResourceCounter.cpp | 167 ++++++++++++++++++++++++++ - qpid/cpp/src/qpid/acl/AclResourceCounter.h | 77 ++++++++++++ - 2 files changed, 244 insertions(+), 0 deletions(-) - create mode 100644 qpid/cpp/src/qpid/acl/AclResourceCounter.cpp - create mode 100644 qpid/cpp/src/qpid/acl/AclResourceCounter.h - -diff --git a/qpid/cpp/src/qpid/acl/AclResourceCounter.cpp b/qpid/cpp/src/qpid/acl/AclResourceCounter.cpp -new file mode 100644 -index 0000000..98bc144 ---- /dev/null -+++ b/qpid/cpp/src/qpid/acl/AclResourceCounter.cpp -@@ -0,0 +1,167 @@ -+/* -+ * -+ * 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. -+ * -+ */ -+ -+#include "AclResourceCounter.h" -+#include "Acl.h" -+#include "qpid/log/Statement.h" -+#include "qpid/sys/Mutex.h" -+#include -+#include -+ -+using namespace qpid::sys; -+ -+namespace qpid { -+namespace acl { -+ -+// -+// This module approves various resource creation requests: -+// Queues -+// -+ -+ -+// -+// -+// -+ResourceCounter::ResourceCounter(Acl& a, uint16_t ql) : -+ acl(a), queueLimit(ql) { -+ QPID_LOG(critical, "ACL RESOURCE_COUNTER queueLimit:" << queueLimit); -+ } -+ -+ResourceCounter::~ResourceCounter() {} -+ -+ -+// -+// limitApproveLH -+// -+// Resource creation approver. -+// If user is under limit increment count and return true. -+// Called with lock held. -+// -+bool ResourceCounter::limitApproveLH( -+ const std::string& theTitle, -+ countsMap_t& theMap, -+ const std::string& theName, -+ uint16_t theLimit, -+ bool emitLog) { -+ -+ bool result(true); -+ if (theLimit > 0) { -+ uint16_t count; -+ countsMap_t::iterator eRef = theMap.find(theName); -+ if (eRef != theMap.end()) { -+ count = (uint16_t)(*eRef).second; -+ result = count < theLimit; -+ if (result) { -+ count += 1; -+ (*eRef).second = count; -+ } -+ } else { -+ // Not found -+ theMap[theName] = count = 1; -+ } -+ if (emitLog) { -+ QPID_LOG(trace, theTitle << theName -+ << " limit=" << theLimit -+ << " curValue=" << count -+ << " result=" << (result ? "allow" : "deny")); -+ } -+ } -+ return result; -+} -+ -+ -+// -+// releaseLH -+// -+// Decrement the name's count in map. -+// called with dataLock already taken -+// -+void ResourceCounter::releaseLH( -+ countsMap_t& theMap, const std::string& theName, uint16_t theLimit) { -+ -+ if (theLimit > 0) { -+ countsMap_t::iterator eRef = theMap.find(theName); -+ if (eRef != theMap.end()) { -+ uint16_t count = (uint16_t) (*eRef).second; -+ assert (count > 0); -+ if (1 == count) { -+ theMap.erase (eRef); -+ } else { -+ (*eRef).second = count - 1; -+ } -+ } else { -+ // User had no connections. -+ QPID_LOG(notice, "ACL ResourceCounter Connection for '" << theName -+ << "' not found in connection count pool"); -+ } -+ } -+} -+ -+ -+// -+// approveCreateQueue -+// Count an attempted queue creation by this user. -+// Disapprove if over limit. -+// -+bool ResourceCounter::approveCreateQueue(const std::string& userId, const std::string& queueName) -+{ -+ Mutex::ScopedLock locker(dataLock); -+ -+ QPID_LOG(critical, "DEV HACK approveCreateQueue ----------- userId:" << userId << ", queueName:" << queueName); -+ -+ bool okByQ = limitApproveLH("ACL Queue creation approver. userId:", queuePerUserMap, userId, queueLimit, true); -+ -+ if (okByQ) { -+ // Queue is owned by this userId -+ queueOwnerMap[queueName] = userId; -+ -+ QPID_LOG(trace, "ACL create queue approved for user '" << userId -+ << "' queue '" << queueName << "'"); -+ } else { -+ -+ QPID_LOG(error, "Client max queue count limit of " << queueLimit -+ << " exceeded by '" << userId << "' creating queue '" -+ << queueName << "'. Queue creation denied."); -+ } -+ return okByQ; -+} -+ -+ -+// -+// recordDestroyQueue -+// Return a destroyed queue to a user's quota -+// -+void ResourceCounter::recordDestroyQueue(const std::string& queueName) -+{ -+ Mutex::ScopedLock locker(dataLock); -+ -+ queueOwnerMap_t::iterator eRef = queueOwnerMap.find(queueName); -+ if (eRef != queueOwnerMap.end()) { -+ releaseLH(queuePerUserMap, (*eRef).second, queueLimit); -+ -+ queueOwnerMap.erase(eRef); -+ } else { -+ QPID_LOG(notice, "ACL owner for queue '" << queueName -+ << "' not found in owner map"); -+ } -+} -+ -+}} // namespace qpid::acl -diff --git a/qpid/cpp/src/qpid/acl/AclResourceCounter.h b/qpid/cpp/src/qpid/acl/AclResourceCounter.h -new file mode 100644 -index 0000000..061ced9 ---- /dev/null -+++ b/qpid/cpp/src/qpid/acl/AclResourceCounter.h -@@ -0,0 +1,77 @@ -+#ifndef QPID_ACL_RESOURCECOUNTER_H -+#define QPID_ACL_RESOURCECOUNTER_H -+ -+/* -+ * -+ * 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. -+ * -+ */ -+ -+#include "qpid/sys/Mutex.h" -+#include -+ -+#include -+ -+namespace qpid { -+ -+namespace acl { -+class Acl; -+ -+ /** -+ * Approve or disapprove resource creation requests -+ */ -+class ResourceCounter -+{ -+private: -+ typedef std::map countsMap_t; -+ typedef std::map queueOwnerMap_t; -+ -+ Acl& acl; -+ uint16_t queueLimit; -+ qpid::sys::Mutex dataLock; -+ -+ /** Records queueName-queueUserId */ -+ queueOwnerMap_t queueOwnerMap; -+ -+ /** Records queue-by-owner counts */ -+ countsMap_t queuePerUserMap; -+ -+ /** Return approval for proposed resource creation */ -+ bool limitApproveLH(const std::string& theTitle, -+ countsMap_t& theMap, -+ const std::string& theName, -+ uint16_t theLimit, -+ bool emitLog); -+ -+ /** Release a connection */ -+ void releaseLH(countsMap_t& theMap, -+ const std::string& theName, -+ uint16_t theLimit); -+ -+public: -+ ResourceCounter(Acl& acl, uint16_t ql); -+ ~ResourceCounter(); -+ -+ // Queue counting -+ bool approveCreateQueue(const std::string& userId, const std::string& queueName); -+ void recordDestroyQueue(const std::string& queueName); -+}; -+ -+}} // namespace qpid::acl -+ -+#endif /*!QPID_ACL_RESOURCECOUNTER_H*/ --- -1.7.1 - -From 37a9e78081db4602fc9970b5649729ab021f0573 Mon Sep 17 00:00:00 2001 -From: Chuck Rolke -Date: Tue, 21 Aug 2012 15:24:13 -0400 -Subject: [PATCH 13/19] QPID-2393 Count queues per user. - Move queue counting out of connection counting files and - into new files. - ---- - qpid/cpp/src/CMakeLists.txt | 2 + - qpid/cpp/src/acl.mk | 2 + - qpid/cpp/src/qpid/acl/Acl.cpp | 9 +- - qpid/cpp/src/qpid/acl/Acl.h | 2 + - qpid/cpp/src/qpid/acl/AclConnectionCounter.cpp | 116 +++--------------------- - qpid/cpp/src/qpid/acl/AclConnectionCounter.h | 35 ++------ - 6 files changed, 32 insertions(+), 134 deletions(-) - -diff --git a/qpid/cpp/src/CMakeLists.txt b/qpid/cpp/src/CMakeLists.txt -index cd1d7b7..62e6dcd 100644 ---- a/qpid/cpp/src/CMakeLists.txt -+++ b/qpid/cpp/src/CMakeLists.txt -@@ -601,6 +601,8 @@ if (BUILD_ACL) - qpid/acl/AclPlugin.cpp - qpid/acl/AclReader.cpp - qpid/acl/AclReader.h -+ qpid/acl/AclResourceCounter.cpp -+ qpid/acl/AclResourceCounter.h - qpid/acl/AclValidator.cpp - qpid/acl/AclValidator.h - ) -diff --git a/qpid/cpp/src/acl.mk b/qpid/cpp/src/acl.mk -index 0301f8c..74f8ef1 100644 ---- a/qpid/cpp/src/acl.mk -+++ b/qpid/cpp/src/acl.mk -@@ -31,6 +31,8 @@ acl_la_SOURCES = \ - qpid/acl/AclPlugin.cpp \ - qpid/acl/AclReader.cpp \ - qpid/acl/AclReader.h \ -+ qpid/acl/AclResourceCounter.cpp \ -+ qpid/acl/AclResourceCounter.h \ - qpid/acl/AclValidator.cpp \ - qpid/acl/AclValidator.h - -diff --git a/qpid/cpp/src/qpid/acl/Acl.cpp b/qpid/cpp/src/qpid/acl/Acl.cpp -index 8116e67..b5a808f 100644 ---- a/qpid/cpp/src/qpid/acl/Acl.cpp -+++ b/qpid/cpp/src/qpid/acl/Acl.cpp -@@ -18,6 +18,7 @@ - - #include "qpid/acl/Acl.h" - #include "qpid/acl/AclConnectionCounter.h" -+#include "qpid/acl/AclResourceCounter.h" - #include "qpid/acl/AclData.h" - #include "qpid/acl/AclValidator.h" - #include "qpid/sys/Mutex.h" -@@ -51,8 +52,8 @@ using qpid::management::Args; - namespace _qmf = qmf::org::apache::qpid::acl; - - Acl::Acl (AclValues& av, Broker& b): aclValues(av), broker(&b), transferAcl(false), mgmtObject(0), -- connectionCounter(new ConnectionCounter(*this, aclValues.aclMaxConnectPerUser, aclValues.aclMaxConnectPerIp, aclValues.aclMaxConnectTotal, aclValues.aclMaxQueuesPerUser)) --{ -+ connectionCounter(new ConnectionCounter(*this, aclValues.aclMaxConnectPerUser, aclValues.aclMaxConnectPerIp, aclValues.aclMaxConnectTotal)), -+ resourceCounter(new ResourceCounter(*this, aclValues.aclMaxQueuesPerUser)){ - - agent = broker->getManagementAgent(); - -@@ -138,13 +139,13 @@ void Acl::setUserId(const qpid::broker::Connection& connection, const std::strin - - bool Acl::approveCreateQueue(const std::string& userId, const std::string& queueName) - { -- return connectionCounter->approveCreateQueue(userId, queueName); -+ return resourceCounter->approveCreateQueue(userId, queueName); - } - - - void Acl::recordDestroyQueue(const std::string& queueName) - { -- connectionCounter->recordDestroyQueue(queueName); -+ resourceCounter->recordDestroyQueue(queueName); - } - - -diff --git a/qpid/cpp/src/qpid/acl/Acl.h b/qpid/cpp/src/qpid/acl/Acl.h -index 918b98c..2097f6c 100644 ---- a/qpid/cpp/src/qpid/acl/Acl.h -+++ b/qpid/cpp/src/qpid/acl/Acl.h -@@ -43,6 +43,7 @@ class Connection; - - namespace acl { - class ConnectionCounter; -+class ResourceCounter; - - struct AclValues { - std::string aclFile; -@@ -65,6 +66,7 @@ private: - qpid::management::ManagementAgent* agent; - mutable qpid::sys::Mutex dataLock; - boost::shared_ptr connectionCounter; -+ boost::shared_ptr resourceCounter; - - public: - Acl (AclValues& av, broker::Broker& b); -diff --git a/qpid/cpp/src/qpid/acl/AclConnectionCounter.cpp b/qpid/cpp/src/qpid/acl/AclConnectionCounter.cpp -index 56dbced..8c6e3ee 100644 ---- a/qpid/cpp/src/qpid/acl/AclConnectionCounter.cpp -+++ b/qpid/cpp/src/qpid/acl/AclConnectionCounter.cpp -@@ -42,10 +42,8 @@ namespace acl { - // - // - // --ConnectionCounter::ConnectionCounter(Acl& a, uint16_t nl, uint16_t hl, uint16_t tl, uint16_t ql) : -- acl(a), nameLimit(nl), hostLimit(hl), totalLimit(tl), queueLimit(ql), totalCurrentConnections(0) { -- QPID_LOG(critical, "ACL CONNECTION_COUNTER nameLimit:" << nameLimit << ", hostLimit:" << hostLimit << ", totalLimit:" << totalLimit << ", queueLimit:" << queueLimit); -- } -+ConnectionCounter::ConnectionCounter(Acl& a, uint16_t nl, uint16_t hl, uint16_t tl) : -+ acl(a), nameLimit(nl), hostLimit(hl), totalLimit(tl), totalCurrentConnections(0) {} - - ConnectionCounter::~ConnectionCounter() {} - -@@ -57,7 +55,7 @@ ConnectionCounter::~ConnectionCounter() {} - // Called with lock held. - // - bool ConnectionCounter::limitApproveLH( -- countsMap_t& theMap, -+ connectCountsMap_t& theMap, - const std::string& theName, - uint16_t theLimit, - bool emitLog) { -@@ -65,7 +63,7 @@ bool ConnectionCounter::limitApproveLH( - bool result(true); - if (theLimit > 0) { - uint16_t count; -- countsMap_t::iterator eRef = theMap.find(theName); -+ connectCountsMap_t::iterator eRef = theMap.find(theName); - if (eRef != theMap.end()) { - count = (uint16_t)(*eRef).second; - result = count <= theLimit; -@@ -75,49 +73,9 @@ bool ConnectionCounter::limitApproveLH( - } - if (emitLog) { - QPID_LOG(trace, "ACL ConnectionApprover IP=" << theName -- << " limit=" << theLimit -- << " curValue=" << count -- << " result=" << (result ? "allow" : "deny")); -- } -- } -- return result; --} -- -- --// --// limitApproveLH --// --// Resource creation approver. --// If user is under limit increment count and return true. --// Called with lock held. --// --bool ConnectionCounter::limitApproveLH( -- const std::string& theTitle, -- countsMap_t& theMap, -- const std::string& theName, -- uint16_t theLimit, -- bool emitLog) { -- -- bool result(true); -- if (theLimit > 0) { -- uint16_t count; -- countsMap_t::iterator eRef = theMap.find(theName); -- if (eRef != theMap.end()) { -- count = (uint16_t)(*eRef).second; -- result = count < theLimit; -- if (result) { -- count += 1; -- (*eRef).second = count; -- } -- } else { -- // Not found -- theMap[theName] = count = 1; -- } -- if (emitLog) { -- QPID_LOG(trace, theTitle << theName -- << " limit=" << theLimit -- << " curValue=" << count -- << " result=" << (result ? "allow" : "deny")); -+ << " limit=" << theLimit -+ << " curValue=" << count -+ << " result=" << (result ? "allow" : "deny")); - } - } - return result; -@@ -131,7 +89,7 @@ bool ConnectionCounter::limitApproveLH( - // called with dataLock already taken - // - bool ConnectionCounter::countConnectionLH( -- countsMap_t& theMap, -+ connectCountsMap_t& theMap, - const std::string& theName, - uint16_t theLimit, - bool emitLog) { -@@ -139,7 +97,7 @@ bool ConnectionCounter::countConnectionLH( - bool result(true); - uint16_t count(0); - if (theLimit > 0) { -- countsMap_t::iterator eRef = theMap.find(theName); -+ connectCountsMap_t::iterator eRef = theMap.find(theName); - if (eRef != theMap.end()) { - count = (uint16_t)(*eRef).second + 1; - (*eRef).second = count; -@@ -165,10 +123,10 @@ bool ConnectionCounter::countConnectionLH( - // called with dataLock already taken - // - void ConnectionCounter::releaseLH( -- countsMap_t& theMap, const std::string& theName, uint16_t theLimit) { -+ connectCountsMap_t& theMap, const std::string& theName, uint16_t theLimit) { - - if (theLimit > 0) { -- countsMap_t::iterator eRef = theMap.find(theName); -+ connectCountsMap_t::iterator eRef = theMap.find(theName); - if (eRef != theMap.end()) { - uint16_t count = (uint16_t) (*eRef).second; - assert (count > 0); -@@ -216,7 +174,7 @@ void ConnectionCounter::closed(broker::Connection& connection) { - - Mutex::ScopedLock locker(dataLock); - -- countsMap_t::iterator eRef = connectProgressMap.find(connection.getMgmtId()); -+ connectCountsMap_t::iterator eRef = connectProgressMap.find(connection.getMgmtId()); - if (eRef != connectProgressMap.end()) { - if ((*eRef).second == C_OPENED){ - // Normal case: connection was created and opened. -@@ -348,7 +306,7 @@ void ConnectionCounter::setUserId(const broker::Connection& connection, - { - Mutex::ScopedLock locker(dataLock); - -- countsMap_t::iterator eRef = connectProgressMap.find(connection.getMgmtId()); -+ connectCountsMap_t::iterator eRef = connectProgressMap.find(connection.getMgmtId()); - if (eRef != connectProgressMap.end()) { - if ((*eRef).second == C_OPENED){ - // Connection has been opened so that current user has been counted -@@ -380,54 +338,6 @@ void ConnectionCounter::setUserId(const broker::Connection& connection, - - - // --// approveCreateQueue --// Count an attempted queue creation by this user. --// Disapprove if over limit. --// --bool ConnectionCounter::approveCreateQueue(const std::string& userId, const std::string& queueName) --{ -- Mutex::ScopedLock locker(dataLock); -- -- QPID_LOG(critical, "approveCreateQueue ----------- userId:" << userId << ", queueName:" << queueName); -- -- bool okByQ = limitApproveLH("ACL Queue creation approver. userId:", queuePerUserMap, userId, queueLimit, true); -- -- if (okByQ) { -- // Queue is owned by this userId -- queueOwnerMap[queueName] = userId; -- -- QPID_LOG(trace, "ACL create queue approved for user '" << userId -- << "' queue '" << queueName << "'"); -- } else { -- -- QPID_LOG(error, "Client max queue count limit of " << queueLimit -- << " exceeded by '" << userId << "' creating queue '" -- << queueName << "'. Queue creation denied."); -- } -- return okByQ; --} -- -- --// --// recordDestroyQueue --// Return a destroyed queue to a user's quota --// --void ConnectionCounter::recordDestroyQueue(const std::string& queueName) --{ -- Mutex::ScopedLock locker(dataLock); -- -- queueOwnerMap_t::iterator eRef = queueOwnerMap.find(queueName); -- if (eRef != queueOwnerMap.end()) { -- releaseLH(queuePerUserMap, (*eRef).second, queueLimit); -- -- queueOwnerMap.erase(eRef); -- } else { -- QPID_LOG(notice, "ACL owner for queue '" << queueName -- << "' not found in owner map"); -- } --} -- --// - // getClientIp - given a connection's mgmtId return the client host part. - // - // TODO: Ideally this would be a method of the connection itself. -diff --git a/qpid/cpp/src/qpid/acl/AclConnectionCounter.h b/qpid/cpp/src/qpid/acl/AclConnectionCounter.h -index 70c60fb..54fa693 100644 ---- a/qpid/cpp/src/qpid/acl/AclConnectionCounter.h -+++ b/qpid/cpp/src/qpid/acl/AclConnectionCounter.h -@@ -44,63 +44,48 @@ class Acl; - class ConnectionCounter : public broker::ConnectionObserver - { - private: -- typedef std::map countsMap_t; -+ typedef std::map connectCountsMap_t; - enum CONNECTION_PROGRESS { C_CREATED=1, C_OPENED=2 }; -- typedef std::map queueOwnerMap_t; - - Acl& acl; - uint16_t nameLimit; - uint16_t hostLimit; - uint16_t totalLimit; -- uint16_t queueLimit; - uint16_t totalCurrentConnections; - qpid::sys::Mutex dataLock; - - /** Records per-connection state */ -- countsMap_t connectProgressMap; -+ connectCountsMap_t connectProgressMap; - - /** Records per-username counts */ -- countsMap_t connectByNameMap; -+ connectCountsMap_t connectByNameMap; - - /** Records per-host counts */ -- countsMap_t connectByHostMap; -- -- /** Records queueName-queueUserId */ -- queueOwnerMap_t queueOwnerMap; -- -- /** Records queue-by-owner counts */ -- countsMap_t queuePerUserMap; -+ connectCountsMap_t connectByHostMap; - - /** Given a connection's management ID, return the client host name */ - std::string getClientHost(const std::string mgmtId); - - /** Return approval for proposed connection */ -- bool limitApproveLH(countsMap_t& theMap, -- const std::string& theName, -- uint16_t theLimit, -- bool emitLog); -- -- /** Return approval for proposed resource creation */ -- bool limitApproveLH(const std::string& theTitle, -- countsMap_t& theMap, -+ bool limitApproveLH(connectCountsMap_t& theMap, - const std::string& theName, - uint16_t theLimit, - bool emitLog); - - /** Record a connection. - * @return indication if user/host is over its limit */ -- bool countConnectionLH(countsMap_t& theMap, -+ bool countConnectionLH(connectCountsMap_t& theMap, - const std::string& theName, - uint16_t theLimit, - bool emitLog); - - /** Release a connection */ -- void releaseLH(countsMap_t& theMap, -+ void releaseLH(connectCountsMap_t& theMap, - const std::string& theName, - uint16_t theLimit); - - public: -- ConnectionCounter(Acl& acl, uint16_t nl, uint16_t hl, uint16_t tl, uint16_t ql); -+ ConnectionCounter(Acl& acl, uint16_t nl, uint16_t hl, uint16_t tl); - ~ConnectionCounter(); - - // ConnectionObserver interface -@@ -110,10 +95,6 @@ public: - // Connection counting - bool approveConnection(const broker::Connection& conn); - void setUserId(const broker::Connection& connection, const std::string& username); -- -- // Queue counting -- bool approveCreateQueue(const std::string& userId, const std::string& queueName); -- void recordDestroyQueue(const std::string& queueName); - }; - - }} // namespace qpid::ha --- -1.7.1 - -From 47e2c4a615ff8d6b2459b0dac6ae494b99cd2f85 Mon Sep 17 00:00:00 2001 -From: Chuck Rolke -Date: Tue, 21 Aug 2012 15:42:03 -0400 -Subject: [PATCH 14/19] QPID-2393 Queue counting per user. - Clean up the self tests and error messages. - ---- - qpid/cpp/src/qpid/acl/AclResourceCounter.cpp | 14 ++++++-------- - qpid/cpp/src/qpid/acl/AclResourceCounter.h | 3 ++- - qpid/cpp/src/tests/acl.py | 15 ++++++++++++--- - qpid/cpp/src/tests/run_acl_tests | 2 +- - 4 files changed, 21 insertions(+), 13 deletions(-) - -diff --git a/qpid/cpp/src/qpid/acl/AclResourceCounter.cpp b/qpid/cpp/src/qpid/acl/AclResourceCounter.cpp -index 98bc144..581c860 100644 ---- a/qpid/cpp/src/qpid/acl/AclResourceCounter.cpp -+++ b/qpid/cpp/src/qpid/acl/AclResourceCounter.cpp -@@ -95,7 +95,7 @@ bool ResourceCounter::limitApproveLH( - // called with dataLock already taken - // - void ResourceCounter::releaseLH( -- countsMap_t& theMap, const std::string& theName, uint16_t theLimit) { -+ const std::string& theTitle, countsMap_t& theMap, const std::string& theName, uint16_t theLimit) { - - if (theLimit > 0) { - countsMap_t::iterator eRef = theMap.find(theName); -@@ -109,8 +109,8 @@ void ResourceCounter::releaseLH( - } - } else { - // User had no connections. -- QPID_LOG(notice, "ACL ResourceCounter Connection for '" << theName -- << "' not found in connection count pool"); -+ QPID_LOG(notice, theTitle << theName -+ << "' not found in resource count pool"); - } - } - } -@@ -125,8 +125,6 @@ bool ResourceCounter::approveCreateQueue(const std::string& userId, const std::s - { - Mutex::ScopedLock locker(dataLock); - -- QPID_LOG(critical, "DEV HACK approveCreateQueue ----------- userId:" << userId << ", queueName:" << queueName); -- - bool okByQ = limitApproveLH("ACL Queue creation approver. userId:", queuePerUserMap, userId, queueLimit, true); - - if (okByQ) { -@@ -155,12 +153,12 @@ void ResourceCounter::recordDestroyQueue(const std::string& queueName) - - queueOwnerMap_t::iterator eRef = queueOwnerMap.find(queueName); - if (eRef != queueOwnerMap.end()) { -- releaseLH(queuePerUserMap, (*eRef).second, queueLimit); -+ releaseLH("ACL resource counter: Queue owner for queue '", queuePerUserMap, (*eRef).second, queueLimit); - - queueOwnerMap.erase(eRef); - } else { -- QPID_LOG(notice, "ACL owner for queue '" << queueName -- << "' not found in owner map"); -+ QPID_LOG(notice, "ACL resource counter: Queue '" << queueName -+ << "' not found in queue owner map"); - } - } - -diff --git a/qpid/cpp/src/qpid/acl/AclResourceCounter.h b/qpid/cpp/src/qpid/acl/AclResourceCounter.h -index 061ced9..f5995eb 100644 ---- a/qpid/cpp/src/qpid/acl/AclResourceCounter.h -+++ b/qpid/cpp/src/qpid/acl/AclResourceCounter.h -@@ -59,7 +59,8 @@ private: - bool emitLog); - - /** Release a connection */ -- void releaseLH(countsMap_t& theMap, -+ void releaseLH(const std::string& theTitle, -+ countsMap_t& theMap, - const std::string& theName, - uint16_t theLimit); - -diff --git a/qpid/cpp/src/tests/acl.py b/qpid/cpp/src/tests/acl.py -index 8055996..180f848 100755 ---- a/qpid/cpp/src/tests/acl.py -+++ b/qpid/cpp/src/tests/acl.py -@@ -2247,12 +2247,13 @@ class ACLTests(TestBase010): - self.LookupPublish("joe@QPID", "QPID-work2", "QPID", "allow") - - #===================================== -- # Queue limits -+ # Queue per-user quota - #===================================== - -- def test__queue_limits(self): -+ def test_queue_per_user_quota(self): - """ -- Test ACL control queue limits -+ Test ACL queue counting limits. -+ port_q has a limit of 2 - """ - # bob should be able to create two queues - session = self.get_session_by_port('bob','bob', self.port_q()) -@@ -2286,6 +2287,7 @@ class ACLTests(TestBase010): - self.fail("Should not be able to create third queue") - except Exception, e: - result = None -+ session2 = self.get_session_by_port('alice','alice', self.port_q()) - - # bob should be able to delete a queue and create another - try: -@@ -2294,6 +2296,13 @@ class ACLTests(TestBase010): - except qpid.session.SessionException, e: - self.fail("Error during queue create request"); - -+ # alice should be able to delete a queue and create another -+ try: -+ session2.queue_delete(queue="queuea1") -+ session2.queue_declare(queue="queuea3") -+ except qpid.session.SessionException, e: -+ self.fail("Error during queue create request"); -+ - class BrokerAdmin: - def __init__(self, broker, username=None, password=None): - self.connection = qpid.messaging.Connection(broker) -diff --git a/qpid/cpp/src/tests/run_acl_tests b/qpid/cpp/src/tests/run_acl_tests -index 652684f..d4d0d74 100755 ---- a/qpid/cpp/src/tests/run_acl_tests -+++ b/qpid/cpp/src/tests/run_acl_tests -@@ -35,7 +35,7 @@ start_brokers() { - LOCAL_PORTI=`cat qpiddi.port` - ../qpidd --daemon --port 0 --no-module-dir --data-dir $DATA_DIRU --load-module $ACL_LIB --acl-file policy.acl --auth no --max-connections-per-user 2 --log-to-file localu.log > qpiddu.port - LOCAL_PORTU=`cat qpiddu.port` -- ../qpidd --daemon --port 0 --no-module-dir --data-dir $DATA_DIRQ --load-module $ACL_LIB --acl-file policy.acl --auth no --max-queues-per-user 2 -t --log-to-file localq.log > qpiddq.port -+ ../qpidd --daemon --port 0 --no-module-dir --data-dir $DATA_DIRQ --load-module $ACL_LIB --acl-file policy.acl --auth no --max-queues-per-user 2 --log-to-file localq.log > qpiddq.port - LOCAL_PORTQ=`cat qpiddq.port` - } - --- -1.7.1 - -From ea700fa9fd73d22c0d366afa175cd9adf96504d3 Mon Sep 17 00:00:00 2001 -From: Chuck Rolke -Date: Tue, 21 Aug 2012 16:12:57 -0400 -Subject: [PATCH 15/19] QPID-2393 Count queues per user. - Add management property, statistic, and event for queues denied. - ---- - qpid/cpp/src/qpid/acl/Acl.cpp | 10 ++++++++++ - qpid/cpp/src/qpid/acl/Acl.h | 1 + - qpid/cpp/src/qpid/acl/management-schema.xml | 4 ++++ - 3 files changed, 15 insertions(+), 0 deletions(-) - -diff --git a/qpid/cpp/src/qpid/acl/Acl.cpp b/qpid/cpp/src/qpid/acl/Acl.cpp -index b5a808f..17afc1b 100644 ---- a/qpid/cpp/src/qpid/acl/Acl.cpp -+++ b/qpid/cpp/src/qpid/acl/Acl.cpp -@@ -33,6 +33,7 @@ - #include "qmf/org/apache/qpid/acl/Package.h" - #include "qmf/org/apache/qpid/acl/EventAllow.h" - #include "qmf/org/apache/qpid/acl/EventConnectionDeny.h" -+#include "qmf/org/apache/qpid/acl/EventQueueQuotaDeny.h" - #include "qmf/org/apache/qpid/acl/EventDeny.h" - #include "qmf/org/apache/qpid/acl/EventFileLoaded.h" - #include "qmf/org/apache/qpid/acl/EventFileLoadFailed.h" -@@ -85,6 +86,15 @@ void Acl::reportConnectLimit(const std::string user, const std::string addr) - } - - -+void Acl::reportQueueLimit(const std::string user, const std::string queueName) -+{ -+ if (mgmtObject!=0) -+ mgmtObject->inc_queueQuotaDenyCount(); -+ -+ agent->raiseEvent(_qmf::EventQueueQuotaDeny(user, queueName)); -+} -+ -+ - bool Acl::authorise( - const std::string& id, - const Action& action, -diff --git a/qpid/cpp/src/qpid/acl/Acl.h b/qpid/cpp/src/qpid/acl/Acl.h -index 2097f6c..e0513d5 100644 ---- a/qpid/cpp/src/qpid/acl/Acl.h -+++ b/qpid/cpp/src/qpid/acl/Acl.h -@@ -75,6 +75,7 @@ public: - * issue management counts and alerts for denied connections - */ - void reportConnectLimit(const std::string user, const std::string addr); -+ void reportQueueLimit(const std::string user, const std::string queueName); - - inline virtual bool doTransferAcl() { - return transferAcl; -diff --git a/qpid/cpp/src/qpid/acl/management-schema.xml b/qpid/cpp/src/qpid/acl/management-schema.xml -index f52c251..5e42e94 100644 ---- a/qpid/cpp/src/qpid/acl/management-schema.xml -+++ b/qpid/cpp/src/qpid/acl/management-schema.xml -@@ -25,8 +25,10 @@ - - - -+ - - -+ - - - -@@ -70,11 +72,13 @@ - - - -+ - - - - - -+ - - - --- -1.7.1 - -From 64dbf3066f0096752f48e15ce364799d45595b49 Mon Sep 17 00:00:00 2001 -From: Chuck Rolke -Date: Wed, 22 Aug 2012 14:32:02 -0400 -Subject: [PATCH 16/19] QPID-2393 Count queues. On disapproving a queue creation do management event and counting. - Get rid of stray debug statement. - ---- - qpid/cpp/src/qpid/acl/AclResourceCounter.cpp | 12 ++++++------ - 1 files changed, 6 insertions(+), 6 deletions(-) - -diff --git a/qpid/cpp/src/qpid/acl/AclResourceCounter.cpp b/qpid/cpp/src/qpid/acl/AclResourceCounter.cpp -index 581c860..66dfd07 100644 ---- a/qpid/cpp/src/qpid/acl/AclResourceCounter.cpp -+++ b/qpid/cpp/src/qpid/acl/AclResourceCounter.cpp -@@ -41,9 +41,7 @@ namespace acl { - // - // - ResourceCounter::ResourceCounter(Acl& a, uint16_t ql) : -- acl(a), queueLimit(ql) { -- QPID_LOG(critical, "ACL RESOURCE_COUNTER queueLimit:" << queueLimit); -- } -+ acl(a), queueLimit(ql) {} - - ResourceCounter::~ResourceCounter() {} - -@@ -79,9 +77,9 @@ bool ResourceCounter::limitApproveLH( - } - if (emitLog) { - QPID_LOG(trace, theTitle << theName -- << " limit=" << theLimit -- << " curValue=" << count -- << " result=" << (result ? "allow" : "deny")); -+ << " limit=" << theLimit -+ << " curValue=" << count -+ << " result=" << (result ? "allow" : "deny")); - } - } - return result; -@@ -138,6 +136,8 @@ bool ResourceCounter::approveCreateQueue(const std::string& userId, const std::s - QPID_LOG(error, "Client max queue count limit of " << queueLimit - << " exceeded by '" << userId << "' creating queue '" - << queueName << "'. Queue creation denied."); -+ -+ acl.reportQueueLimit(userId, queueName); - } - return okByQ; - } --- -1.7.1 - -From 932a4a3ef623577501c42f83eb45fb1f668d18e8 Mon Sep 17 00:00:00 2001 -From: Chuck Rolke -Date: Thu, 23 Aug 2012 13:50:29 -0400 -Subject: [PATCH 17/19] QPID-2393 Count queues per user. Show queue limit in mgmt property. - ---- - qpid/cpp/src/qpid/acl/Acl.cpp | 1 + - 1 files changed, 1 insertions(+), 0 deletions(-) - -diff --git a/qpid/cpp/src/qpid/acl/Acl.cpp b/qpid/cpp/src/qpid/acl/Acl.cpp -index 17afc1b..6eeda9f 100644 ---- a/qpid/cpp/src/qpid/acl/Acl.cpp -+++ b/qpid/cpp/src/qpid/acl/Acl.cpp -@@ -65,6 +65,7 @@ Acl::Acl (AclValues& av, Broker& b): aclValues(av), broker(&b), transferAcl(fals - mgmtObject->set_maxConnections(aclValues.aclMaxConnectTotal); - mgmtObject->set_maxConnectionsPerIp(aclValues.aclMaxConnectPerIp); - mgmtObject->set_maxConnectionsPerUser(aclValues.aclMaxConnectPerUser); -+ mgmtObject->set_maxQueuesPerUser(aclValues.aclMaxQueuesPerUser); - } - std::string errorString; - if (!readAclFile(errorString)){ --- -1.7.1 - -From a1d72e1b65a1f639e248260a8bf4dcdebb3b30ac Mon Sep 17 00:00:00 2001 -From: Chuck Rolke -Date: Tue, 28 Aug 2012 09:57:52 -0400 -Subject: [PATCH 18/19] BZ-783428 Add FILE SIZE/COUNT limit checks to Acl processor. - ---- - qpid/cpp/src/qpid/acl/AclData.cpp | 14 ++ - qpid/cpp/src/qpid/acl/AclValidator.cpp | 16 ++ - qpid/cpp/src/qpid/broker/AclModule.h | 20 ++- - qpid/cpp/src/qpid/broker/Broker.cpp | 2 + - qpid/cpp/src/tests/acl.py | 282 ++++++++++++++++++++++++++++++++ - 5 files changed, 333 insertions(+), 1 deletions(-) - -diff --git a/qpid/cpp/src/qpid/acl/AclData.cpp b/qpid/cpp/src/qpid/acl/AclData.cpp -index 6994de2..feb8b9d 100644 ---- a/qpid/cpp/src/qpid/acl/AclData.cpp -+++ b/qpid/cpp/src/qpid/acl/AclData.cpp -@@ -199,6 +199,16 @@ namespace acl { - lookupParamItr = params->find(PROP_MAXQUEUESIZE); - break; - -+ case acl::SPECPROP_MAXFILECOUNTUPPERLIMIT: -+ case acl::SPECPROP_MAXFILECOUNTLOWERLIMIT: -+ lookupParamItr = params->find(PROP_MAXFILECOUNT); -+ break; -+ -+ case acl::SPECPROP_MAXFILESIZEUPPERLIMIT: -+ case acl::SPECPROP_MAXFILESIZELOWERLIMIT: -+ lookupParamItr = params->find(PROP_MAXFILESIZE); -+ break; -+ - default: - lookupParamItr = params->find((Property)rulePropMapItr->first); - break; -@@ -222,6 +232,8 @@ namespace acl { - { - case acl::SPECPROP_MAXQUEUECOUNTUPPERLIMIT: - case acl::SPECPROP_MAXQUEUESIZEUPPERLIMIT: -+ case acl::SPECPROP_MAXFILECOUNTUPPERLIMIT: -+ case acl::SPECPROP_MAXFILESIZEUPPERLIMIT: - limitChecked &= - compareIntMax( - rulePropMapItr->first, -@@ -231,6 +243,8 @@ namespace acl { - - case acl::SPECPROP_MAXQUEUECOUNTLOWERLIMIT: - case acl::SPECPROP_MAXQUEUESIZELOWERLIMIT: -+ case acl::SPECPROP_MAXFILECOUNTLOWERLIMIT: -+ case acl::SPECPROP_MAXFILESIZELOWERLIMIT: - limitChecked &= - compareIntMin( - rulePropMapItr->first, -diff --git a/qpid/cpp/src/qpid/acl/AclValidator.cpp b/qpid/cpp/src/qpid/acl/AclValidator.cpp -index 85f0f7c..73b49b2 100644 ---- a/qpid/cpp/src/qpid/acl/AclValidator.cpp -+++ b/qpid/cpp/src/qpid/acl/AclValidator.cpp -@@ -94,6 +94,22 @@ namespace acl { - boost::shared_ptr( - new IntPropertyType(0,std::numeric_limits::max())))); - -+ validators.insert(Validator(acl::SPECPROP_MAXFILESIZELOWERLIMIT, -+ boost::shared_ptr( -+ new IntPropertyType(0,std::numeric_limits::max())))); -+ -+ validators.insert(Validator(acl::SPECPROP_MAXFILESIZEUPPERLIMIT, -+ boost::shared_ptr( -+ new IntPropertyType(0,std::numeric_limits::max())))); -+ -+ validators.insert(Validator(acl::SPECPROP_MAXFILECOUNTLOWERLIMIT, -+ boost::shared_ptr( -+ new IntPropertyType(0,std::numeric_limits::max())))); -+ -+ validators.insert(Validator(acl::SPECPROP_MAXFILECOUNTUPPERLIMIT, -+ boost::shared_ptr( -+ new IntPropertyType(0,std::numeric_limits::max())))); -+ - std::string policyTypes[] = {"ring", "ring_strict", "flow_to_disk", "reject"}; - std::vector v(policyTypes, policyTypes + sizeof(policyTypes) / sizeof(std::string)); - validators.insert(Validator(acl::SPECPROP_POLICYTYPE, -diff --git a/qpid/cpp/src/qpid/broker/AclModule.h b/qpid/cpp/src/qpid/broker/AclModule.h -index 987d3e4..4070e49 100644 ---- a/qpid/cpp/src/qpid/broker/AclModule.h -+++ b/qpid/cpp/src/qpid/broker/AclModule.h -@@ -79,6 +79,8 @@ namespace acl { - PROP_POLICYTYPE, - PROP_MAXQUEUESIZE, - PROP_MAXQUEUECOUNT, -+ PROP_MAXFILESIZE, -+ PROP_MAXFILECOUNT, - PROPERTYSIZE // PROPERTYSIZE must be last in list - }; - -@@ -102,7 +104,11 @@ namespace acl { - SPECPROP_MAXQUEUESIZELOWERLIMIT, - SPECPROP_MAXQUEUESIZEUPPERLIMIT, - SPECPROP_MAXQUEUECOUNTLOWERLIMIT, -- SPECPROP_MAXQUEUECOUNTUPPERLIMIT }; -+ SPECPROP_MAXQUEUECOUNTUPPERLIMIT, -+ SPECPROP_MAXFILESIZELOWERLIMIT, -+ SPECPROP_MAXFILESIZEUPPERLIMIT, -+ SPECPROP_MAXFILECOUNTLOWERLIMIT, -+ SPECPROP_MAXFILECOUNTUPPERLIMIT }; - - // AclResult shared between ACL spec and ACL authorise interface - enum AclResult { -@@ -227,6 +233,8 @@ namespace acl { - if (str.compare("policytype") == 0) return PROP_POLICYTYPE; - if (str.compare("maxqueuesize") == 0) return PROP_MAXQUEUESIZE; - if (str.compare("maxqueuecount") == 0) return PROP_MAXQUEUECOUNT; -+ if (str.compare("maxfilesize") == 0) return PROP_MAXFILESIZE; -+ if (str.compare("maxfilecount") == 0) return PROP_MAXFILECOUNT; - throw qpid::Exception(str); - } - static inline std::string getPropertyStr(const Property p) { -@@ -245,6 +253,8 @@ namespace acl { - case PROP_POLICYTYPE: return "policytype"; - case PROP_MAXQUEUESIZE: return "maxqueuesize"; - case PROP_MAXQUEUECOUNT: return "maxqueuecount"; -+ case PROP_MAXFILESIZE: return "maxfilesize"; -+ case PROP_MAXFILECOUNT: return "maxfilecount"; - default: assert(false); // should never get here - } - return ""; -@@ -266,6 +276,10 @@ namespace acl { - if (str.compare("queuemaxsizeupperlimit") == 0) return SPECPROP_MAXQUEUESIZEUPPERLIMIT; - if (str.compare("queuemaxcountlowerlimit") == 0) return SPECPROP_MAXQUEUECOUNTLOWERLIMIT; - if (str.compare("queuemaxcountupperlimit") == 0) return SPECPROP_MAXQUEUECOUNTUPPERLIMIT; -+ if (str.compare("filemaxsizelowerlimit") == 0) return SPECPROP_MAXFILESIZELOWERLIMIT; -+ if (str.compare("filemaxsizeupperlimit") == 0) return SPECPROP_MAXFILESIZEUPPERLIMIT; -+ if (str.compare("filemaxcountlowerlimit") == 0) return SPECPROP_MAXFILECOUNTLOWERLIMIT; -+ if (str.compare("filemaxcountupperlimit") == 0) return SPECPROP_MAXFILECOUNTUPPERLIMIT; - // Allow old names in ACL file as aliases for newly-named properties - if (str.compare("maxqueuesize") == 0) return SPECPROP_MAXQUEUESIZEUPPERLIMIT; - if (str.compare("maxqueuecount") == 0) return SPECPROP_MAXQUEUECOUNTUPPERLIMIT; -@@ -289,6 +303,10 @@ namespace acl { - case SPECPROP_MAXQUEUESIZEUPPERLIMIT: return "queuemaxsizeupperlimit"; - case SPECPROP_MAXQUEUECOUNTLOWERLIMIT: return "queuemaxcountlowerlimit"; - case SPECPROP_MAXQUEUECOUNTUPPERLIMIT: return "queuemaxcountupperlimit"; -+ case SPECPROP_MAXFILESIZELOWERLIMIT: return "filemaxsizelowerlimit"; -+ case SPECPROP_MAXFILESIZEUPPERLIMIT: return "filemaxsizeupperlimit"; -+ case SPECPROP_MAXFILECOUNTLOWERLIMIT: return "filemaxcountlowerlimit"; -+ case SPECPROP_MAXFILECOUNTUPPERLIMIT: return "filemaxcountupperlimit"; - default: assert(false); // should never get here - } - return ""; -diff --git a/qpid/cpp/src/qpid/broker/Broker.cpp b/qpid/cpp/src/qpid/broker/Broker.cpp -index be7340a..06a2df8 100644 ---- a/qpid/cpp/src/qpid/broker/Broker.cpp -+++ b/qpid/cpp/src/qpid/broker/Broker.cpp -@@ -1073,6 +1073,8 @@ std::pair, bool> Broker::createQueue( - params.insert(make_pair(acl::PROP_POLICYTYPE, arguments.getAsString("qpid.policy_type"))); - params.insert(make_pair(acl::PROP_MAXQUEUECOUNT, boost::lexical_cast(arguments.getAsInt("qpid.max_count")))); - params.insert(make_pair(acl::PROP_MAXQUEUESIZE, boost::lexical_cast(arguments.getAsInt64("qpid.max_size")))); -+ params.insert(make_pair(acl::PROP_MAXFILECOUNT, boost::lexical_cast(arguments.getAsInt("qpid.file_count")))); -+ params.insert(make_pair(acl::PROP_MAXFILESIZE, boost::lexical_cast(arguments.getAsInt64("qpid.file_size")))); - - if (!acl->authorise(userId,acl::ACT_CREATE,acl::OBJ_QUEUE,name,¶ms) ) - throw framing::UnauthorizedAccessException(QPID_MSG("ACL denied queue create request from " << userId)); -diff --git a/qpid/cpp/src/tests/acl.py b/qpid/cpp/src/tests/acl.py -index 180f848..3d138ab 100755 ---- a/qpid/cpp/src/tests/acl.py -+++ b/qpid/cpp/src/tests/acl.py -@@ -545,6 +545,123 @@ class ACLTests(TestBase010): - self.fail(result) - - -+ def test_illegal_filemaxsize_upper_limit_spec(self): -+ """ -+ Test illegal file policy -+ """ -+ # -+ # Use filemaxsizeupperlimit -+ # -+ aclf = self.get_acl_file() -+ aclf.write('acl deny bob@QPID create queue name=q2 filemaxsizeupperlimit=-1\n') -+ aclf.write('acl allow all all') -+ aclf.close() -+ -+ result = self.reload_acl() -+ expected = "-1 is not a valid value for 'filemaxsizeupperlimit', " \ -+ "values should be between 0 and 9223372036854775807"; -+ if (result.find(expected) == -1): -+ self.fail(result) -+ -+ aclf = self.get_acl_file() -+ aclf.write('acl deny bob@QPID create queue name=q2 filemaxsizeupperlimit=9223372036854775808\n') -+ aclf.write('acl allow all all') -+ aclf.close() -+ -+ result = self.reload_acl() -+ expected = "9223372036854775808 is not a valid value for 'filemaxsizeupperlimit', " \ -+ "values should be between 0 and 9223372036854775807"; -+ if (result.find(expected) == -1): -+ self.fail(result) -+ -+ -+ -+ def test_illegal_filemaxcount_upper_limit_spec(self): -+ """ -+ Test illegal file policy -+ """ -+ # -+ # use maxfilecountupperlimit -+ # -+ aclf = self.get_acl_file() -+ aclf.write('acl deny bob@QPID create queue name=q2 filemaxcountupperlimit=-1\n') -+ aclf.write('acl allow all all') -+ aclf.close() -+ -+ result = self.reload_acl() -+ expected = "-1 is not a valid value for 'filemaxcountupperlimit', " \ -+ "values should be between 0 and 9223372036854775807"; -+ if (result.find(expected) == -1): -+ self.fail(result) -+ -+ aclf = self.get_acl_file() -+ aclf.write('acl deny bob@QPID create queue name=q2 filemaxcountupperlimit=9223372036854775808\n') -+ aclf.write('acl allow all all') -+ aclf.close() -+ -+ result = self.reload_acl() -+ expected = "9223372036854775808 is not a valid value for 'filemaxcountupperlimit', " \ -+ "values should be between 0 and 9223372036854775807"; -+ if (result.find(expected) == -1): -+ self.fail(result) -+ -+ -+ def test_illegal_filemaxsize_lower_limit_spec(self): -+ """ -+ Test illegal file policy -+ """ -+ aclf = self.get_acl_file() -+ aclf.write('acl deny bob@QPID create queue name=q2 filemaxsizelowerlimit=-1\n') -+ aclf.write('acl allow all all') -+ aclf.close() -+ -+ result = self.reload_acl() -+ expected = "-1 is not a valid value for 'filemaxsizelowerlimit', " \ -+ "values should be between 0 and 9223372036854775807"; -+ if (result.find(expected) == -1): -+ self.fail(result) -+ -+ aclf = self.get_acl_file() -+ aclf.write('acl deny bob@QPID create queue name=q2 filemaxsizelowerlimit=9223372036854775808\n') -+ aclf.write('acl allow all all') -+ aclf.close() -+ -+ result = self.reload_acl() -+ expected = "9223372036854775808 is not a valid value for 'filemaxsizelowerlimit', " \ -+ "values should be between 0 and 9223372036854775807"; -+ if (result.find(expected) == -1): -+ self.fail(result) -+ -+ -+ -+ def test_illegal_filemaxcount_lower_limit_spec(self): -+ """ -+ Test illegal file policy -+ """ -+ -+ aclf = self.get_acl_file() -+ aclf.write('acl deny bob@QPID create queue name=q2 filemaxcountlowerlimit=-1\n') -+ aclf.write('acl allow all all') -+ aclf.close() -+ -+ result = self.reload_acl() -+ expected = "-1 is not a valid value for 'filemaxcountlowerlimit', " \ -+ "values should be between 0 and 9223372036854775807"; -+ if (result.find(expected) == -1): -+ self.fail(result) -+ -+ aclf = self.get_acl_file() -+ aclf.write('acl deny bob@QPID create queue name=q2 filemaxcountlowerlimit=9223372036854775808\n') -+ aclf.write('acl allow all all') -+ aclf.close() -+ -+ result = self.reload_acl() -+ expected = "9223372036854775808 is not a valid value for 'filemaxcountlowerlimit', " \ -+ "values should be between 0 and 9223372036854775807"; -+ if (result.find(expected) == -1): -+ self.fail(result) -+ -+ - #===================================== - # ACL queue tests - #===================================== -@@ -834,6 +951,171 @@ class ACLTests(TestBase010): - self.fail("ACL should allow queue delete request for q4"); - - #===================================== -+ # ACL file tests -+ #===================================== -+ -+ def test_file_allow_mode(self): -+ """ -+ Test cases for file acl in allow mode -+ """ -+ aclf = self.get_acl_file() -+ aclf.write('acl deny bob@QPID access queue name=qf1\n') -+ aclf.write('acl deny bob@QPID create queue name=qf1 durable=true\n') -+ aclf.write('acl deny bob@QPID create queue name=qf2 exclusive=true policytype=ring\n') -+ aclf.write('acl deny bob@QPID access queue name=qf3\n') -+ aclf.write('acl deny bob@QPID purge queue name=qf3\n') -+ aclf.write('acl deny bob@QPID delete queue name=qf4\n') -+ aclf.write('acl deny bob@QPID create queue name=qf5 filemaxsizeupperlimit=1000 filemaxcountupperlimit=100\n') -+ aclf.write('acl allow all all') -+ aclf.close() -+ -+ result = self.reload_acl() -+ if (result): -+ self.fail(result) -+ -+ session = self.get_session('bob','bob') -+ -+ try: -+ queue_options = {} -+ queue_options["qpid.file_count"] = 200 -+ queue_options["qpid.file_size"] = 500 -+ session.queue_declare(queue="qf5", exclusive=True, arguments=queue_options) -+ self.fail("ACL should deny queue create request with name=qf5, qpid.file_size=500 and qpid.file_count=200"); -+ except qpid.session.SessionException, e: -+ self.assertEqual(403,e.args[0].error_code) -+ session = self.get_session('bob','bob') -+ -+ try: -+ queue_options = {} -+ queue_options["qpid.file_count"] = 200 -+ queue_options["qpid.file_size"] = 100 -+ session.queue_declare(queue="qf2", exclusive=True, arguments=queue_options) -+ except qpid.session.SessionException, e: -+ if (403 == e.args[0].error_code): -+ self.fail("ACL should allow queue create request with name=qf2, qpid.file_size=100 and qpid.file_count=200 "); -+ -+ -+ def test_file_deny_mode(self): -+ """ -+ Test cases for queue acl in deny mode -+ """ -+ aclf = self.get_acl_file() -+ aclf.write('acl allow bob@QPID access queue name=qfd1\n') -+ aclf.write('acl allow bob@QPID create queue name=qfd1 durable=true\n') -+ aclf.write('acl allow bob@QPID create queue name=qfd2 exclusive=true policytype=ring\n') -+ aclf.write('acl allow bob@QPID access queue name=qfd3\n') -+ aclf.write('acl allow bob@QPID purge queue name=qfd3\n') -+ aclf.write('acl allow bob@QPID create queue name=qfd3\n') -+ aclf.write('acl allow bob@QPID create queue name=qfd4\n') -+ aclf.write('acl allow bob@QPID delete queue name=qfd4\n') -+ aclf.write('acl allow bob@QPID create queue name=qfd5 filemaxsizeupperlimit=1000 filemaxcountupperlimit=100\n') -+ aclf.write('acl allow bob@QPID create queue name=qfd6 filemaxsizelowerlimit=50 filemaxsizeupperlimit=100 filemaxcountlowerlimit=50 filemaxcountupperlimit=100\n') -+ aclf.write('acl allow anonymous all all\n') -+ aclf.write('acl deny all all') -+ aclf.close() -+ -+ result = self.reload_acl() -+ if (result): -+ self.fail(result) -+ -+ session = self.get_session('bob','bob') -+ -+ try: -+ session.queue_declare(queue="qfd1", durable=True) -+ except qpid.session.SessionException, e: -+ if (403 == e.args[0].error_code): -+ self.fail("ACL should allow queue create request with name=qfd1 durable=true"); -+ -+ try: -+ session.queue_declare(queue="qfd1", durable=True, passive=True) -+ except qpid.session.SessionException, e: -+ if (403 == e.args[0].error_code): -+ self.fail("ACL should allow queue passive declare request with name=qfd1 durable=true passive=true"); -+ -+ try: -+ session.queue_declare(queue="qfd1", durable=False, passive=False) -+ self.fail("ACL should deny queue create request with name=qfd1 durable=true passive=false"); -+ except qpid.session.SessionException, e: -+ self.assertEqual(403,e.args[0].error_code) -+ session = self.get_session('bob','bob') -+ -+ try: -+ session.queue_declare(queue="qfd2", exclusive=False) -+ self.fail("ACL should deny queue create request with name=qfd2 exclusive=false"); -+ except qpid.session.SessionException, e: -+ self.assertEqual(403,e.args[0].error_code) -+ session = self.get_session('bob','bob') -+ -+ try: -+ queue_options = {} -+ queue_options["qpid.file_count"] = 200 -+ queue_options["qpid.file_size"] = 500 -+ session.queue_declare(queue="qfd5", arguments=queue_options) -+ self.fail("ACL should deny queue create request with name=qfd5 filemaxsizeupperlimit=500 filemaxcountupperlimit=200"); -+ except qpid.session.SessionException, e: -+ self.assertEqual(403,e.args[0].error_code) -+ session = self.get_session('bob','bob') -+ -+ try: -+ queue_options = {} -+ queue_options["qpid.file_count"] = 100 -+ queue_options["qpid.file_size"] = 500 -+ session.queue_declare(queue="qfd5", arguments=queue_options) -+ except qpid.session.SessionException, e: -+ if (403 == e.args[0].error_code): -+ self.fail("ACL should allow queue create request with name=qfd5 filemaxsizeupperlimit=500 filemaxcountupperlimit=200"); -+ -+ try: -+ queue_options = {} -+ queue_options["qpid.file_count"] = 49 -+ queue_options["qpid.file_size"] = 100 -+ session.queue_declare(queue="qfd6", arguments=queue_options) -+ self.fail("ACL should deny queue create request with name=qfd6 filemaxsizeupperlimit=100 filemaxcountupperlimit=49"); -+ except qpid.session.SessionException, e: -+ self.assertEqual(403,e.args[0].error_code) -+ session = self.get_session('bob','bob') -+ -+ try: -+ queue_options = {} -+ queue_options["qpid.file_count"] = 101 -+ queue_options["qpid.file_size"] = 100 -+ session.queue_declare(queue="qfd6", arguments=queue_options) -+ self.fail("ACL should allow queue create request with name=qfd6 filemaxsizeupperlimit=100 filemaxcountupperlimit=101"); -+ except qpid.session.SessionException, e: -+ self.assertEqual(403,e.args[0].error_code) -+ session = self.get_session('bob','bob') -+ -+ try: -+ queue_options = {} -+ queue_options["qpid.file_count"] = 100 -+ queue_options["qpid.file_size"] = 49 -+ session.queue_declare(queue="qfd6", arguments=queue_options) -+ self.fail("ACL should deny queue create request with name=qfd6 filemaxsizeupperlimit=49 filemaxcountupperlimit=100"); -+ except qpid.session.SessionException, e: -+ self.assertEqual(403,e.args[0].error_code) -+ session = self.get_session('bob','bob') -+ -+ try: -+ queue_options = {} -+ queue_options["qpid.file_count"] = 100 -+ queue_options["qpid.file_size"] =101 -+ session.queue_declare(queue="qfd6", arguments=queue_options) -+ self.fail("ACL should deny queue create request with name=qfd6 filemaxsizeupperlimit=101 filemaxcountupperlimit=100"); -+ except qpid.session.SessionException, e: -+ self.assertEqual(403,e.args[0].error_code) -+ session = self.get_session('bob','bob') -+ -+ try: -+ queue_options = {} -+ queue_options["qpid.file_count"] = 50 -+ queue_options["qpid.file_size"] = 50 -+ session.queue_declare(queue="qfd6", arguments=queue_options) -+ except qpid.session.SessionException, e: -+ if (403 == e.args[0].error_code): -+ self.fail("ACL should allow queue create request with name=qfd6 filemaxsizeupperlimit=50 filemaxcountupperlimit=50"); -+ -+ -+ #===================================== - # ACL exchange tests - #===================================== - --- -1.7.1 - -From b4dcc8feb765e60e4e189221f0c7f18d7906439c Mon Sep 17 00:00:00 2001 -From: Charles E. Rolke -Date: Fri, 24 Aug 2012 21:50:59 +0000 -Subject: [PATCH 19/19] QPID-4249 TopicExchange binding lookup for all routing keys - -git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1377130 13f79535-47bb-0310-9956-ffa450edef68 ---- - qpid/cpp/src/qpid/acl/AclData.cpp | 21 +++++- - qpid/cpp/src/qpid/acl/AclReader.cpp | 17 +++-- - qpid/cpp/src/tests/acl.py | 125 ++++++++++++++++++++++++++++++++++- - 3 files changed, 152 insertions(+), 11 deletions(-) - -diff --git a/qpid/cpp/src/qpid/acl/AclData.cpp b/qpid/cpp/src/qpid/acl/AclData.cpp -index feb8b9d..997fbdf 100644 ---- a/qpid/cpp/src/qpid/acl/AclData.cpp -+++ b/qpid/cpp/src/qpid/acl/AclData.cpp -@@ -255,14 +255,31 @@ namespace acl { - default: - bool result; - if ((SPECPROP_ALTERNATE == rulePropMapItr->first && rsItr->ruleHasUserSub[PROP_ALTERNATE]) || -- (SPECPROP_ROUTINGKEY == rulePropMapItr->first && rsItr->ruleHasUserSub[PROP_ROUTINGKEY]) || - (SPECPROP_QUEUENAME == rulePropMapItr->first && rsItr->ruleHasUserSub[PROP_QUEUENAME])) - { - // These properties are allowed to have username substitution - std::string sName(rulePropMapItr->second); - substituteUserId(sName, id); - result = matchProp(sName, lookupParamItr->second); -- } else { -+ } -+ else if (SPECPROP_ROUTINGKEY == rulePropMapItr->first) -+ { -+ // Routing key is allowed to have username substitution -+ // and it gets topic exchange matching -+ if (rsItr->ruleHasUserSub[PROP_ROUTINGKEY]) -+ { -+ std::string sKey(lookupParamItr->second); -+ substituteKeywords(sKey, id); -+ result = rsItr->matchRoutingKey(sKey); -+ } -+ else -+ { -+ result = rsItr->matchRoutingKey(lookupParamItr->second); -+ } -+ } -+ else -+ { -+ // Rules without substitution - result = matchProp(rulePropMapItr->second, lookupParamItr->second); - } - -diff --git a/qpid/cpp/src/qpid/acl/AclReader.cpp b/qpid/cpp/src/qpid/acl/AclReader.cpp -index fae67d0..3d5a666 100644 ---- a/qpid/cpp/src/qpid/acl/AclReader.cpp -+++ b/qpid/cpp/src/qpid/acl/AclReader.cpp -@@ -112,6 +112,16 @@ namespace acl { - } - } - -+ // Find possible routingkey property and cache its pattern -+ for (pmCitr pItr=rule.props.begin(); pItr!=rule.props.end(); pItr++) { -+ if (acl::SPECPROP_ROUTINGKEY == pItr->first) -+ { -+ rule.pubRoutingKeyInRule = true; -+ rule.pubRoutingKey = (std::string)pItr->second; -+ rule.addTopicTest(rule.pubRoutingKey); -+ } -+ } -+ - // Action -> Object -> map set > - std::ostringstream actionstr; - for (int acnt = ((*i)->actionAll ? 0 : (*i)->action); -@@ -126,13 +136,6 @@ namespace acl { - // Go through the rule properties and find the name and the key. - // If found then place them specially for the lookup engine. - for (pmCitr pItr=(*i)->props.begin(); pItr!=(*i)->props.end(); pItr++) { -- if (acl::SPECPROP_ROUTINGKEY == pItr->first) -- { -- rule.pubRoutingKeyInRule = true; -- rule.pubRoutingKey = (std::string)pItr->second; -- rule.addTopicTest(rule.pubRoutingKey); -- break; -- } - if (acl::SPECPROP_NAME == pItr->first) - { - rule.pubExchNameInRule = true; -diff --git a/qpid/cpp/src/tests/acl.py b/qpid/cpp/src/tests/acl.py -index 3d138ab..1020a2e 100755 ---- a/qpid/cpp/src/tests/acl.py -+++ b/qpid/cpp/src/tests/acl.py -@@ -1823,10 +1823,10 @@ class ACLTests(TestBase010): - - - #===================================== -- # QMF Topic Exchange tests -+ # Routingkey lookup using Topic Exchange tests - #===================================== - -- def test_qmf_topic_exchange_tests(self): -+ def test_topic_exchange_publish_tests(self): - """ - Test using QMF method hooks into ACL logic - """ -@@ -1940,6 +1940,127 @@ class ACLTests(TestBase010): - self.LookupPublish("dev@QPID", "X", "a.M.N", "allow-log") - self.LookupPublish("dev@QPID", "X", "a.M.p.qq.N", "allow-log") - -+ def test_topic_exchange_other_tests(self): -+ """ -+ Test using QMF method hooks into ACL logic -+ """ -+ action_list = ['access','bind','unbind'] -+ -+ aclf = self.get_acl_file() -+ aclf.write('# begin hack alert: allow anonymous to access the lookup debug functions\n') -+ aclf.write('acl allow-log anonymous create queue\n') -+ aclf.write('acl allow-log anonymous all exchange name=qmf.*\n') -+ aclf.write('acl allow-log anonymous all exchange name=amq.direct\n') -+ aclf.write('acl allow-log anonymous all exchange name=qpid.management\n') -+ aclf.write('acl allow-log anonymous access method name=*\n') -+ aclf.write('# end hack alert\n') -+ for action in action_list: -+ aclf.write('acl allow-log uPlain1@COMPANY ' + action + ' exchange name=X routingkey=ab.cd.e\n') -+ aclf.write('acl allow-log uPlain2@COMPANY ' + action + ' exchange name=X routingkey=.\n') -+ aclf.write('acl allow-log uStar1@COMPANY ' + action + ' exchange name=X routingkey=a.*.b\n') -+ aclf.write('acl allow-log uStar2@COMPANY ' + action + ' exchange name=X routingkey=*.x\n') -+ aclf.write('acl allow-log uStar3@COMPANY ' + action + ' exchange name=X routingkey=x.x.*\n') -+ aclf.write('acl allow-log uHash1@COMPANY ' + action + ' exchange name=X routingkey=a.#.b\n') -+ aclf.write('acl allow-log uHash2@COMPANY ' + action + ' exchange name=X routingkey=a.#\n') -+ aclf.write('acl allow-log uHash3@COMPANY ' + action + ' exchange name=X routingkey=#.a\n') -+ aclf.write('acl allow-log uHash4@COMPANY ' + action + ' exchange name=X routingkey=a.#.b.#.c\n') -+ aclf.write('acl allow-log uMixed1@COMPANY ' + action + ' exchange name=X routingkey=*.x.#.y\n') -+ aclf.write('acl allow-log uMixed2@COMPANY ' + action + ' exchange name=X routingkey=a.#.b.*\n') -+ aclf.write('acl allow-log uMixed3@COMPANY ' + action + ' exchange name=X routingkey=*.*.*.#\n') -+ -+ aclf.write('acl allow-log all ' + action + ' exchange name=X routingkey=MN.OP.Q\n') -+ aclf.write('acl allow-log all ' + action + ' exchange name=X routingkey=M.*.N\n') -+ aclf.write('acl allow-log all ' + action + ' exchange name=X routingkey=M.#.N\n') -+ aclf.write('acl allow-log all ' + action + ' exchange name=X routingkey=*.M.#.N\n') -+ -+ aclf.write('acl deny-log all all\n') -+ aclf.close() -+ -+ result = self.reload_acl() -+ if (result): -+ self.fail(result) -+ -+ for action in action_list: -+ # aclKey: "ab.cd.e" -+ self.Lookup("uPlain1@COMPANY", action, "exchange", "X", {"routingkey":"ab.cd.e"}, "allow-log") -+ self.Lookup("uPlain1@COMPANY", action, "exchange", "X", {"routingkey":"ab.cd.e"}, "allow-log") -+ -+ self.Lookup("uPlain1@COMPANY", action, "exchange", "X", {"routingkey":"ab.cd.e"}, "allow-log") -+ self.Lookup("uPlain1@COMPANY", action, "exchange", "X", {"routingkey":"abx.cd.e"}, "deny-log") -+ self.Lookup("uPlain1@COMPANY", action, "exchange", "X", {"routingkey":"ab.cd"}, "deny-log") -+ self.Lookup("uPlain1@COMPANY", action, "exchange", "X", {"routingkey":"ab.cd..e."}, "deny-log") -+ self.Lookup("uPlain1@COMPANY", action, "exchange", "X", {"routingkey":"ab.cd.e."}, "deny-log") -+ self.Lookup("uPlain1@COMPANY", action, "exchange", "X", {"routingkey":".ab.cd.e"}, "deny-log") -+ # aclKey: "." -+ self.Lookup("uPlain2@COMPANY", action, "exchange", "X", {"routingkey":"."}, "allow-log") -+ -+ # aclKey: "a.*.b" -+ self.Lookup("uStar1@COMPANY", action, "exchange", "X", {"routingkey":"a.xx.b"}, "allow-log") -+ self.Lookup("uStar1@COMPANY", action, "exchange", "X", {"routingkey":"a.b"}, "deny-log") -+ # aclKey: "*.x" -+ self.Lookup("uStar2@COMPANY", action, "exchange", "X", {"routingkey":"y.x"}, "allow-log") -+ self.Lookup("uStar2@COMPANY", action, "exchange", "X", {"routingkey":".x"}, "allow-log") -+ self.Lookup("uStar2@COMPANY", action, "exchange", "X", {"routingkey":"x"}, "deny-log") -+ # aclKey: "x.x.*" -+ self.Lookup("uStar3@COMPANY", action, "exchange", "X", {"routingkey":"x.x.y"}, "allow-log") -+ self.Lookup("uStar3@COMPANY", action, "exchange", "X", {"routingkey":"x.x."}, "allow-log") -+ self.Lookup("uStar3@COMPANY", action, "exchange", "X", {"routingkey":"x.x"}, "deny-log") -+ self.Lookup("uStar3@COMPANY", action, "exchange", "X", {"routingkey":"q.x.y"}, "deny-log") -+ -+ # aclKey: "a.#.b" -+ self.Lookup("uHash1@COMPANY", action, "exchange", "X", {"routingkey":"a.b"}, "allow-log") -+ self.Lookup("uHash1@COMPANY", action, "exchange", "X", {"routingkey":"a.x.b"}, "allow-log") -+ self.Lookup("uHash1@COMPANY", action, "exchange", "X", {"routingkey":"a..x.y.zz.b"}, "allow-log") -+ self.Lookup("uHash1@COMPANY", action, "exchange", "X", {"routingkey":"a.b."}, "deny-log") -+ self.Lookup("uHash1@COMPANY", action, "exchange", "X", {"routingkey":"q.x.b"}, "deny-log") -+ -+ # aclKey: "a.#" -+ self.Lookup("uHash2@COMPANY", action, "exchange", "X", {"routingkey":"a"}, "allow-log") -+ self.Lookup("uHash2@COMPANY", action, "exchange", "X", {"routingkey":"a.b"}, "allow-log") -+ self.Lookup("uHash2@COMPANY", action, "exchange", "X", {"routingkey":"a.b.c"}, "allow-log") -+ -+ # aclKey: "#.a" -+ self.Lookup("uHash3@COMPANY", action, "exchange", "X", {"routingkey":"a"}, "allow-log") -+ self.Lookup("uHash3@COMPANY", action, "exchange", "X", {"routingkey":"x.y.a"}, "allow-log") -+ -+ # aclKey: "a.#.b.#.c" -+ self.Lookup("uHash4@COMPANY", action, "exchange", "X", {"routingkey":"a.b.c"}, "allow-log") -+ self.Lookup("uHash4@COMPANY", action, "exchange", "X", {"routingkey":"a.x.b.y.c"}, "allow-log") -+ self.Lookup("uHash4@COMPANY", action, "exchange", "X", {"routingkey":"a.x.x.b.y.y.c"}, "allow-log") -+ -+ # aclKey: "*.x.#.y" -+ self.Lookup("uMixed1@COMPANY", action, "exchange", "X", {"routingkey":"a.x.y"}, "allow-log") -+ self.Lookup("uMixed1@COMPANY", action, "exchange", "X", {"routingkey":"a.x.p.qq.y"}, "allow-log") -+ self.Lookup("uMixed1@COMPANY", action, "exchange", "X", {"routingkey":"a.a.x.y"}, "deny-log") -+ self.Lookup("uMixed1@COMPANY", action, "exchange", "X", {"routingkey":"aa.x.b.c"}, "deny-log") -+ -+ # aclKey: "a.#.b.*" -+ self.Lookup("uMixed2@COMPANY", action, "exchange", "X", {"routingkey":"a.b.x"}, "allow-log") -+ self.Lookup("uMixed2@COMPANY", action, "exchange", "X", {"routingkey":"a.x.x.x.b.x"}, "allow-log") -+ -+ # aclKey: "*.*.*.#" -+ self.Lookup("uMixed3@COMPANY", action, "exchange", "X", {"routingkey":"x.y.z"}, "allow-log") -+ self.Lookup("uMixed3@COMPANY", action, "exchange", "X", {"routingkey":"x.y.z.a.b.c"}, "allow-log") -+ self.Lookup("uMixed3@COMPANY", action, "exchange", "X", {"routingkey":"x.y"}, "deny-log") -+ self.Lookup("uMixed3@COMPANY", action, "exchange", "X", {"routingkey":"x"}, "deny-log") -+ -+ # Repeat the keys with wildcard user spec -+ self.Lookup("uPlain1@COMPANY", action, "exchange", "X", {"routingkey":"MN.OP.Q"}, "allow-log") -+ self.Lookup("uStar1@COMPANY" , action, "exchange", "X", {"routingkey":"M.xx.N"}, "allow-log") -+ self.Lookup("uHash1@COMPANY" , action, "exchange", "X", {"routingkey":"M.N"}, "allow-log") -+ self.Lookup("uHash1@COMPANY" , action, "exchange", "X", {"routingkey":"M.x.N"}, "allow-log") -+ self.Lookup("uHash1@COMPANY" , action, "exchange", "X", {"routingkey":"M..x.y.zz.N"}, "allow-log") -+ self.Lookup("uMixed1@COMPANY", action, "exchange", "X", {"routingkey":"a.M.N"}, "allow-log") -+ self.Lookup("uMixed1@COMPANY", action, "exchange", "X", {"routingkey":"a.M.p.qq.N"}, "allow-log") -+ -+ self.Lookup("dev@QPID", action, "exchange", "X", {"routingkey": "MN.OP.Q"}, "allow-log") -+ self.Lookup("dev@QPID", action, "exchange", "X", {"routingkey": "M.xx.N"}, "allow-log") -+ self.Lookup("dev@QPID", action, "exchange", "X", {"routingkey": "M.N"}, "allow-log") -+ self.Lookup("dev@QPID", action, "exchange", "X", {"routingkey": "M.x.N"}, "allow-log") -+ self.Lookup("dev@QPID", action, "exchange", "X", {"routingkey": "M..x.y.zz.N"}, "allow-log") -+ self.Lookup("dev@QPID", action, "exchange", "X", {"routingkey": "a.M.N"}, "allow-log") -+ self.Lookup("dev@QPID", action, "exchange", "X", {"routingkey": "a.M.p.qq.N"}, "allow-log") -+ - #===================================== - # Connection limits - #===================================== --- -1.7.1 - diff --git a/rpms/awips2.qpid/0.18/SOURCES/qpid-0.18.tar.gz b/rpms/awips2.qpid/0.18/SOURCES/qpid-0.18.tar.gz deleted file mode 100644 index be23ddb38d..0000000000 Binary files a/rpms/awips2.qpid/0.18/SOURCES/qpid-0.18.tar.gz and /dev/null differ diff --git a/rpms/awips2.qpid/0.18/SOURCES/qpid-build-deps-0.18.tar.gz b/rpms/awips2.qpid/0.18/SOURCES/qpid-build-deps-0.18.tar.gz deleted file mode 100644 index 5e61c410e6..0000000000 Binary files a/rpms/awips2.qpid/0.18/SOURCES/qpid-build-deps-0.18.tar.gz and /dev/null differ diff --git a/rpms/awips2.qpid/0.18/SOURCES/qpid-deps-0.18.tar.gz b/rpms/awips2.qpid/0.18/SOURCES/qpid-deps-0.18.tar.gz deleted file mode 100644 index 0f1325c03c..0000000000 Binary files a/rpms/awips2.qpid/0.18/SOURCES/qpid-deps-0.18.tar.gz and /dev/null differ diff --git a/rpms/awips2.qpid/0.18/SOURCES/qpid-messageNotFound.patch b/rpms/awips2.qpid/0.18/SOURCES/qpid-messageNotFound.patch deleted file mode 100644 index 3519e08446..0000000000 --- a/rpms/awips2.qpid/0.18/SOURCES/qpid-messageNotFound.patch +++ /dev/null @@ -1,137 +0,0 @@ -diff -crB a/qpid-0.18/java/broker/src/main/java/org/apache/qpid/server/queue/QueueEntryImpl.java b/qpid-0.18/java/broker/src/main/java/org/apache/qpid/server/queue/QueueEntryImpl.java -*** a/qpid-0.18/java/broker/src/main/java/org/apache/qpid/server/queue/QueueEntryImpl.java 2012-06-28 11:46:12.000000000 -0500 ---- b/qpid-0.18/java/broker/src/main/java/org/apache/qpid/server/queue/QueueEntryImpl.java 2013-09-16 13:26:48.000000000 -0500 -*************** -*** 38,47 **** - import java.util.concurrent.atomic.AtomicIntegerFieldUpdater; - import java.util.concurrent.atomic.AtomicLongFieldUpdater; - import java.util.concurrent.atomic.AtomicReferenceFieldUpdater; - - public abstract class QueueEntryImpl implements QueueEntry - { -! private static final Logger _log = Logger.getLogger(QueueEntryImpl.class); - - private final QueueEntryList _queueEntryList; - ---- 38,48 ---- - import java.util.concurrent.atomic.AtomicIntegerFieldUpdater; - import java.util.concurrent.atomic.AtomicLongFieldUpdater; - import java.util.concurrent.atomic.AtomicReferenceFieldUpdater; -+ import java.util.logging.Level; - - public abstract class QueueEntryImpl implements QueueEntry - { -! private static final java.util.logging.Logger _log = java.util.logging.Logger.getLogger(QueueEntryImpl.class.getName()); - - private final QueueEntryList _queueEntryList; - -*************** -*** 145,156 **** - ServerMessage message = getMessage(); - if(message != null) - { -! long expiration = message.getExpiration(); -! if (expiration != 0L) -! { -! long now = System.currentTimeMillis(); - -! return (now > expiration); - } - } - return false; ---- 146,162 ---- - ServerMessage message = getMessage(); - if(message != null) - { -! try { -! long expiration = message.getExpiration(); -! if (expiration != 0L) -! { -! long now = System.currentTimeMillis(); - -! return (now > expiration); -! } -! } catch (Exception e) { -! _log.log(Level.SEVERE, "Caught exception checking if message is expired. Message State: " + _state.getState().name(), e); -! return isAvailable(); - } - } - return false; -*************** -*** 343,349 **** - } - else - { -! _log.warn("Requesting rejection by null subscriber:" + this); - } - } - ---- 349,355 ---- - } - else - { -! _log.warning("Requesting rejection by null subscriber:" + this); - } - } - -diff -crB a/qpid-0.18/java/broker/src/main/java/org/apache/qpid/server/queue/SimpleAMQQueue.java b/qpid-0.18/java/broker/src/main/java/org/apache/qpid/server/queue/SimpleAMQQueue.java -*** a/qpid-0.18/java/broker/src/main/java/org/apache/qpid/server/queue/SimpleAMQQueue.java 2012-07-08 10:30:05.000000000 -0500 ---- b/qpid-0.18/java/broker/src/main/java/org/apache/qpid/server/queue/SimpleAMQQueue.java 2013-09-16 14:15:11.000000000 -0500 -*************** -*** 36,41 **** ---- 36,42 ---- - import java.util.concurrent.atomic.AtomicLong; - - import org.apache.log4j.Logger; -+ import org.apache.log4j.Level; - import org.apache.qpid.AMQException; - import org.apache.qpid.AMQSecurityException; - import org.apache.qpid.framing.AMQShortString; -*************** -*** 1053,1060 **** - - public long getOldestMessageArrivalTime() - { -! QueueEntry entry = getOldestQueueEntry(); -! return entry == null ? Long.MAX_VALUE : entry.getMessage().getArrivalTime(); - } - - protected QueueEntry getOldestQueueEntry() ---- 1054,1090 ---- - - public long getOldestMessageArrivalTime() - { -! int tries = 0; -! QueueEntry prev = null; -! -! while (tries < 3) { -! QueueEntry entry = null; -! try { -! entry = getOldestQueueEntry(); -! return entry == null ? Long.MAX_VALUE : entry.getMessage().getArrivalTime(); -! } catch (Exception e) { -! if ((prev == null) || (prev != entry)) { -! tries++; -! _logger.log(Level.FATAL, -! "Error occurred getting oldest message arrival time, message: " -! + entry + ", attempt " + tries + " of 3", e); -! prev = entry; -! } else { -! // same invalid entry returned, try deleting? -! _logger.log(Level.WARN, -! "Received same invalid entry on getting oldest message, attempting discard."); -! try { -! entry.discard(); -! } catch (Exception e2) { -! _logger.log(Level.ERROR, -! "Failed to discard message. Restart recommended if errors continue", e2); -! } -! } -! } -! } -! -! // default case -! return Long.MAX_VALUE; - } - - protected QueueEntry getOldestQueueEntry() diff --git a/rpms/awips2.qpid/0.18/SOURCES/qpid-wrapper b/rpms/awips2.qpid/0.18/SOURCES/qpid-wrapper deleted file mode 100644 index 5a909eb315..0000000000 --- a/rpms/awips2.qpid/0.18/SOURCES/qpid-wrapper +++ /dev/null @@ -1,51 +0,0 @@ -#!/bin/bash -# -# 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. -# - -# this version of the qpid start script will utilize the yajsw wrapper - -CONF_FILE="wrapper.conf" - -WHEREAMI=`dirname $0` -if [ -z "$QPID_HOME" ]; then - export QPID_HOME=`cd $WHEREAMI/../ && pwd` -fi - -if [ -z "$QPID_WORK" ]; then - export QPID_WORK=$QPID_HOME -fi - -if [ -z "${QPID_PID_FILENAME}" ]; then - export QPID_PID_FILENAME="qpid-server.pid" -fi - -# Set other variables used by the wrapper -export JAVA=/awips2/java/bin/java \ - JAVA_VM=-server \ - AMQJ_LOGGING_LEVEL=info \ - QPID_PNAME=" -DPNAME=QPBRKR" \ - CONSOLE_LOGLEVEL=DEBUG - -if [ ! -f ${JAVA} ]; then - echo "ERROR: the specified Java does not exist - ${JAVA}." - echo "Unable to Continue ... Terminating." - exit 1 -fi - -$JAVA -Xmx32m -XX:MaxPermSize=12m -XX:ReservedCodeCacheSize=4m -jar ${QPID_HOME}/bin/yajsw/wrapper.jar -c ${QPID_HOME}/conf/${CONF_FILE} diff --git a/rpms/awips2.qpid/0.18/SOURCES/qpidd b/rpms/awips2.qpid/0.18/SOURCES/qpidd deleted file mode 100644 index 76fc3fde7d..0000000000 --- a/rpms/awips2.qpid/0.18/SOURCES/qpidd +++ /dev/null @@ -1,159 +0,0 @@ -#!/bin/bash -# -# qpidd This shell script takes care of starting and stopping -# the AWIPS qpid instance. -# -# chkconfig: - 99 10 -# description: Qpid messaging broker used by the AWIPS 2 instance -# processname: qpid-server -# config: /awips2/qpid/etc/config.xml - - -# Source function library. -. /etc/rc.d/init.d/functions - -# Source networking configuration. -. /etc/sysconfig/network - -# Check that networking is up. -[ ${NETWORKING} = "no" ] && exit 0 - -RETVAL=0 -prog="qpid-wrapper" - -# Who to run QPID as, usually "awips". (NOT "root") -QPIDUSER=awips - -# Todays date in format of YYYYMMDD. -TODAY=`/bin/date +%Y%m%d` - -QPID_HOME=/awips2/qpid -wrapper_process="org.rzo.yajsw.app.WrapperJVMMain" -_wrapper_jar=${QPID_HOME}/bin/yajsw/wrapper.jar - -function getQPID_psCount() -{ - psCount_qpid=`ps -ef | grep ${wrapper_process} | grep QPID_HOME="${QPID_HOME}" | grep -c "PNAME=QPBRKR "` -} - -function getQPID_pid() -{ - pid_qpid=`ps -e -o pid,args | grep ${wrapper_process} | grep QPID_HOME="${QPID_HOME}" | grep "PNAME=QPBRKR " | grep -e "^ *\([0-9]\+\)" -o` -} - -function getWrapper_psCount() -{ - psCount_wrapper=`ps -ef | grep "${_wrapper_jar} -c" | grep -c wrapper.conf` -} - -function getWrapper_pid() -{ - pid_wrapper=`ps -e -o pid,args | grep "${_wrapper_jar} -c" | grep wrapper.conf | grep -e "^ *\([0-9]\+\)" -o` -} - -start() { - getQPID_psCount - if [ ${psCount_qpid} -eq 1 ]; then - echo "WARNING: QPID already running, not starting another instance" - return 1 - fi - - DAEMON="/bin/bash ${QPID_HOME}/bin/${prog}" - - QPIDSTARTLOG=${QPID_HOME}/log/start-qpid-$TODAY.log - su $QPIDUSER -c "$DAEMON" >> $QPIDSTARTLOG 2>&1 & - sleep 5 - checkStatus -} - -stop() { - # determine if qpid is running, first. - getQPID_psCount - if [ ${psCount_qpid} -ne 1 ]; then - echo "WARNING: Qpid is not running, no shutdown attempted!" - return 1 - fi - # get the qpid pid - getQPID_pid - - # determine if the qpid wrapper is running. - getWrapper_psCount - if [ ${psCount_wrapper} -eq 1 ]; then - # get the wrapper pid - getWrapper_pid - - # stop the wrapper - kill ${pid_wrapper} - else - # stop qpid - kill ${pid_qpid} - fi - - # wait for and verify that qpid has stopped running - savepid=${pid_qpid} - while [ "X${pid_qpid}" != "X" ]; do - sleep 1 - - getQPID_psCount - if [ ${psCount_qpid} -eq 1 ]; then - pid_qpid=${savepid} - else - pid_qpid="" - fi - done -} - -checkStatus() { - getQPID_psCount - if [ ${psCount_qpid} -eq 1 ]; then - getQPID_pid - echo "QPID is running (PID ${pid_qpid})" - else - echo "QPID is not running" - fi -} - -# Verify root user -checkUser() { - REQUIREDUSER="root" - CURUSER=`whoami` - if [ "$CURUSER" != "$REQUIREDUSER" ]; then - echo "Insufficient privileges: must run script as $REQUIREDUSER" - exit 1 - fi -} - -# See how we were called. -case $1 in - start) - checkUser - echo "Starting QPID" - start - RETVAL=$? - ;; - stop) - checkUser - echo "Stopping QPID" - stop - RETVAL=$? - ;; - restart) - checkUser - echo "Stopping QPID" - stop - echo "Starting QPID" - start - RETVAL=$? - ;; - status) - checkStatus - RETVAL=$? - ;; - *) - # Print help - echo "Usage: $0 {start|stop|restart|reload|status}" 1>&2 - exit 1 - ;; -esac - -exit $RETVAL diff --git a/rpms/awips2.qpid/0.18/SOURCES/virtualhosts.xml b/rpms/awips2.qpid/0.18/SOURCES/virtualhosts.xml deleted file mode 100644 index 3fa62abf79..0000000000 --- a/rpms/awips2.qpid/0.18/SOURCES/virtualhosts.xml +++ /dev/null @@ -1,76 +0,0 @@ - - - - - edex - - - edex - - - org.apache.qpid.server.store.derby.DerbyMessageStore - ${QPID_WORK}/messageStore - - - - amq.direct - - - - 5294080 - - - 2117632 - - - 300000 - - - 15000 - true - - - - - - - - diff --git a/rpms/awips2.qpid/0.18/SOURCES/wrapper.conf b/rpms/awips2.qpid/0.18/SOURCES/wrapper.conf deleted file mode 100644 index 55b2f065cb..0000000000 --- a/rpms/awips2.qpid/0.18/SOURCES/wrapper.conf +++ /dev/null @@ -1,134 +0,0 @@ -#******************************************************************** -## -# This software was developed and / or modified by Raytheon Company, -# pursuant to Contract DG133W-05-CQ-1067 with the US Government. -# -# U.S. EXPORT CONTROLLED TECHNICAL DATA -# This software product contains export-restricted data whose -# export/transfer/disclosure is restricted by U.S. law. Dissemination -# to non-U.S. persons whether in the United States or abroad requires -# an export license or other authorization. -# -# Contractor Name: Raytheon Company -# Contractor Address: 6825 Pine Street, Suite 340 -# Mail Stop B8 -# Omaha, NE 68106 -# 402.291.0100 -# -# See the AWIPS II Master Rights File ("Master Rights File.pdf") for -# further licensing information. -## -# Wrapper Properties -#******************************************************************** - -wrapper.debug=false -set.default.QPID_HOME=../.. -wrapper.working.dir=/awips2/qpid/bin -# required due to java bug: -# http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4388188 -# not sure if the yajsw developers have any intention of -# implementing the work-around (solution?) stated in the -# ticket. -wrapper.fork_hack=true -# at a minimum: prevents the printing of the "Invalid parameter" messages -wrapper.console.pipestreams=true - -# Java Application -wrapper.java.command=/awips2/java/bin/java - -# Java Classpath (include wrapper.jar) Add class path elements as -# needed starting from 1 -wrapper.java.classpath.1=${QPID_HOME}/bin/yajsw/wrapper.jar - -# include ANY jar files that are found in the locations denoted by -# wrapper.search.java.classpath.# -wrapper.search.java.classpath.1=${QPID_HOME}/lib/opt -wrapper.search.java.classpath.2=${QPID_HOME}/lib/opt/qpid-deps - -# garbage collection settings -wrapper.java.additional.gc.1=-XX:+UseConcMarkSweepGC -wrapper.java.additional.gc.2=-XX:+CMSIncrementalMode -wrapper.java.additional.gc.3=-XX:NewSize=400m -wrapper.java.additional.gc.4=-XX:MaxNewSize=400m -wrapper.java.additional.gc.5=-XX:SurvivorRatio=4 -wrapper.java.additional.gc.6=-XX:+HeapDumpOnOutOfMemoryError -wrapper.java.additional.gc.7=-XX:HeapDumpPath=/data/fxa/qpid - -# the main qpid java class that will be started -wrapper.java.app.mainclass=org.apache.qpid.server.Main - -# Java Additional Parameters -# note that n is the parameter number starting from 1. -wrapper.java.additional.1=${JAVA_VM} -wrapper.java.additional.2=${QPID_PNAME} -wrapper.java.additional.3=-Damqj.logging.level=${AMQJ_LOGGING_LEVEL} -wrapper.java.additional.4=-DQPID_HOME=${QPID_HOME} -wrapper.java.additional.5=-DQPID_WORK=${QPID_WORK} -wrapper.java.additional.6=-Damqj.read_write_pool_size=32 -wrapper.java.additional.7=-Dqpid.broker.exceptionHandler.continue=true - -# Maximum Java Heap Size (in MB) -wrapper.java.maxmemory=1536 - -wrapper.ping.interval=5 -wrapper.ping.timeout=30 - -# NOTE: script must be located at /awips2/qpid/bin/yajsw/scripts for it to be found -wrapper.script.ABORT=wrapperCapture.sh -wrapper.script.ABORT.timeout=120 -wrapper.script.RESTART=wrapperCapture.sh -wrapper.script.RESTART.timeout=120 - -#******************************************************************** -# Monitor the Application -#******************************************************************** -wrapper.java.monitor.heap = true -# warning messages will be logged; it is also possible to send an e-mail -wrapper.java.monitor.heap.threshold.percent = 90 - -wrapper.java.monitor.deadlock = true -wrapper.filter.trigger.deadlock.restart=wrapper.java.monitor.deadlock: DEADLOCK IN THREADS: -wrapper.filter.action.deadlock.restart=RESTART - -# restart the application if it runs out of memory -wrapper.filter.trigger.1=java.lang.OutOfMemoryError -wrapper.filter.action.1=RESTART - -# restart the application if it crashes -wrapper.on_exit.default=RESTART - -#******************************************************************** -# Wrapper Logging Properties -#******************************************************************** -# Format of output for the console. (See docs for formats) -wrapper.console.format=M - -# Log file to use for wrapper output logging. -wrapper.logfile=${QPID_HOME}/log/qpid-wrapper-YYYYMMDD.log - -# Format of output for the log file. (See docs for formats) -wrapper.logfile.format=LTM - -# Log Level for log file output. (See docs for log levels) -wrapper.logfile.loglevel=INFO - -# Set the log rollover mode for the log. -# DATE - creates a new file each day - file name must include YYYYMMDD. -# SIZE - uses log size for log roll-over. -wrapper.logfile.rollmode=DATE - -# Maximum number of rolled log files which will be allowed before old -# files are deleted. The default value of 0 implies no limit. -wrapper.logfile.maxfiles=7 - -# Log Level for console output. (See docs for log levels) -wrapper.console.loglevel=${CONSOLE_LOGLEVEL} - -# Log Level for log file output. (See docs for log levels) -wrapper.logfile.loglevel=INFO - -#******************************************************************** -# Wrapper Windows Properties -#******************************************************************** -# Title to use when running as a console -wrapper.console.title=QPID diff --git a/rpms/awips2.qpid/0.18/SOURCES/yajsw-distribution.tar b/rpms/awips2.qpid/0.18/SOURCES/yajsw-distribution.tar deleted file mode 100644 index 6cb101c956..0000000000 Binary files a/rpms/awips2.qpid/0.18/SOURCES/yajsw-distribution.tar and /dev/null differ diff --git a/rpms/awips2.qpid/0.18/SPECS/qpid-java.spec b/rpms/awips2.qpid/0.18/SPECS/qpid-java.spec deleted file mode 100644 index 55ddb4c42f..0000000000 --- a/rpms/awips2.qpid/0.18/SPECS/qpid-java.spec +++ /dev/null @@ -1,389 +0,0 @@ -Name: qpid-java -Version: 0.18 -Release: 2%{?dist} -Summary: Java implementation of Apache Qpid -License: Apache Software License -Group: Development/Java -URL: http://qpid.apache.org/ - -%global qpid_src_dir qpid-%{version} -%global qpid_deps_src_dir qpid-deps-%{version} - -Source0: %{qpid_src_dir}.tar.gz -Source1: qpid-build-deps-%{version}.tar.gz -Source2: %{qpid_deps_src_dir}.tar.gz - -Patch0: mrg.patch -Patch1: examples.patch -Patch2: build.patch - -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) -BuildArch: noarch -BuildRequires: ant >= 1.6.5 -BuildRequires: ant-nodeps >= 1.6.5 -BuildRequires: java-devel >= 1.6.0 -BuildRequires: ant-trax >= 1.6.5 - -%description -Java implementation of Apache Qpid. - -%package common -Summary: Java implementation of Apache Qpid - common files -Group: Development/Java -BuildArch: noarch - -%description common -Java implementation of Apache Qpid - common files - -%package client -Summary: Java implementation of Apache Qpid - client -Group: Development/Java -BuildArch: noarch -Requires: qpid-java-common = %{version}-%{release} -Requires: log4j >= 1.2.12 - -%description client -Java implementation of Apache Qpid - client - -%package example -Summary: Java implementation of Apache Qpid - example -Group: Development/Java -BuildArch: noarch -Requires: qpid-java-client = %{version}-%{release} - -%description example -Java implementation of Apache Qpid - example - -%prep -%setup -q -n %{qpid_src_dir} -mkdir -p java/lib/required -tar -xvzf %SOURCE1 -C java/lib/required - -%patch0 -p2 -%patch1 -p2 -%patch2 -p2 - -%setup -q -T -b 2 -n %{qpid_deps_src_dir} - -%build -cd .. - -( - cd %{qpid_src_dir}/java - ant -Dretrieve.dependencies=false -Dmodules=common\ client - - # blacklisted jars are either provided by the Requires: or not needed. - BLACKLIST="slf4j qpid-client-tests qpid-all qpid-common-tests" - for jar in $BLACKLIST; do rm build/lib/${jar}*.jar; done -) - -(cd %{qpid_deps_src_dir}; ant -Dqpid-src-dir=../%{qpid_src_dir}/java -Dversion=%{version}) - -%install -rm -rf %{buildroot} - -cd .. - -install -dm 755 %{buildroot}%{_javadir} -install -pm 644 %{qpid_src_dir}/java/build/lib/qpid-client-%{version}.jar %{buildroot}%{_javadir} -install -pm 644 %{qpid_src_dir}/java/build/lib/qpid-client-%{version}-sources.jar %{buildroot}%{_javadir} -install -pm 644 %{qpid_src_dir}/java/build/lib/qpid-common-%{version}.jar %{buildroot}%{_javadir} -install -pm 644 %{qpid_src_dir}/java/build/lib/qpid-common-%{version}-sources.jar %{buildroot}%{_javadir} - -install -dm 755 %{buildroot}%{_javadir}/qpid-deps -install -pm 644 %{qpid_src_dir}/java/build/lib/log4j-slf4j.jar %{buildroot}%{_javadir}/qpid-deps -install -pm 644 %{qpid_src_dir}/java/build/lib/qpid-deps-%{version}.jar %{buildroot}%{_javadir}/qpid-deps - -# examples - -install -dm 755 %{buildroot}%{_docdir}/%{name}-%{version}/examples/org/apache/qpid/example/ -install -pm 644 %{qpid_src_dir}/java/client/example/src/main/java/org/apache/qpid/example/*.java \ - %{buildroot}%{_docdir}/%{name}-%{version}/examples/org/apache/qpid/example/ -install -pm 644 %{qpid_src_dir}/java/client/example/src/main/java/org/apache/qpid/example/hello.properties \ - %{buildroot}%{_docdir}/%{name}-%{version}/examples/org/apache/qpid/example/ -install -pm 644 %{qpid_src_dir}/java/client/example/example.log4j \ - %{buildroot}%{_docdir}/%{name}-%{version}/examples/ -install -pm 755 %{qpid_src_dir}/java/client/example/bin/run_example.sh \ - %{buildroot}%{_docdir}/%{name}-%{version}/examples/ - -%clean -rm -rf %{buildroot} - -%files common -%defattr(-,root,root,-) -%{_javadir}/qpid-deps/ -%{_javadir}/qpid-common-%{version}.jar -%{_javadir}/qpid-common-%{version}-sources.jar -%doc ../%{qpid_src_dir}/java/resources/LICENSE -%doc ../%{qpid_src_dir}/java/resources/NOTICE - -%files client -%defattr(-,root,root,-) -%{_javadir}/qpid-client-%{version}.jar -%{_javadir}/qpid-client-%{version}-sources.jar - -%files example -%defattr(-,root,root,-) -%{_docdir}/%{name}-%{version}/examples/ - -%changelog -* Thu Sep 6 2012 Irina Boverman - 0.18-2 -- Resolved bz 851574 - -* Tue Jul 10 2012 Justin Ross - 0.18-1 -- Refactored spec file to use standard Qpid source export -- Rebased to Qpid 0.18 beta source - -* Thu Feb 23 2012 Rajith Attapattu - 0:0.14-3 -- Added a patch to account for changes between 0.14-rc1 and HEAD of 0.14-mrg-preview. - -* Thu Feb 16 2012 Rajith Attapattu - 0:0.14-2 -- Added a patch to account for changes between 0.14-rc1 and HEAD of 0.14-mrg-preview. - -* Mon Dec 12 2011 Rajith Attapattu - 0:0.14-1 -- Rebased the client to use the Qpid 0.14 RC1 source. -- Added a patch to account for changes between 0.14-rc1 and HEAD of 0.14-mrg-preview. - -* Fri Sep 23 2011 Andrew Stitcher - 0:0.10-11 -- Added new qpid-java-jca-zip package which wraps a zip of everything - in qpid jca. -- Make qpid-deps jar have correct 0.10 version -- Updated patch to include latest Qpid JCA work: - BZ.738316 - BZ 733383 - BZ 736252 - BZ 700500 - BZ 707535 - BZ 722614 - BZ 735030 - BZ 738615 - BZ 700494 - BZ 705913 - BZ 723714 - BZ 735384 - BZ 736794 - BZ 737880 - BZ 735322 - BZ 736785 - -* Tue Sep 14 2011 Rajith Attapattu - 0:0.10-9 -- Added a patch to account for changes between 0.10 and mrg_2.0.3 head rev on Sep 14th. - -* Mon May 16 2011 Rajith Attapattu - 0:0.10.-6 -- Added a patch to account for changes between 0.10 and qpid-0.10-package-set-7 tags. - -* Thu Apr 28 2011 Andrew Stitcher - 0:0.10.-5 -- Removed jar file that was not meant to be in qpid-java-common - -* Wed Apr 20 2011 Rajith Attapattu - 0:0.10.-4 -- Added a patch to account for changes between 0.10 and qpid-0.10-package-set-5 tags. - -* Thu Apr 14 2011 Ted Ross - 0:0.10-3 -- Added a patch to fix BZ694617 - -* Wed Apr 6 2011 Rajith Attapattu - 0:0.10.-2 -- Added a patch to include QPID-3177 which is included in the upstream 0.10 release. -- Fixed an error in the qpid-deps source tarball. - -* Thu Mar 24 2011 Rajith Attapattu - 0:0.10.-1 -- Change the version from 0.10.1083082 to 0.10. - -* Wed Mar 23 2011 Rajith Attapattu - 0:0.10.1083082-1 -- Updated the source files to rev 1083082 in Qpid 0.10 branch. - -* Thu Mar 10 2011 Andrew Stitcher - 0:0.9.1080013-3 -- Fixed issue that stopped deployment on JBoss 5 -- Added sample deployment resource -- Added some JCA example code -- Added separate Readme for JBoss deployment - -* Thu Mar 10 2011 Andrew Stitcher - 0:0.9.1080013-2 -- Updated JCA package added some documentation to it. -- Add qpid-deps jar into the qpid-ra rar file to supply dependencies for - qpid-common/qpid-client jars - -* Wed Mar 9 2011 Rajith Attapattu - 0:0.9.1080013-1 -- Updated the source files to rev 1080013 in Qpid 0.10 branch. - -* Tue Mar 8 2011 Andrew Stitcher - 0:0.9.1073306-3 -- Changed JCA build to use source for jar dependents - -* Wed Mar 2 2011 Andrew Stitcher - 0:0.9.1073306-2 -- Added new sub-package for JCA resource adapter - -* Thu Feb 24 2011 Rajith Attapattu - 0:0.9.1073306-1 -- Updated the source files to rev 1073306 in Qpid trunk. - -* Thu Jan 27 2011 Rajith Attapattu - 0:0.7.946106-15 -- Applied another patch for BZ 656488, 672212. - -* Wed Jan 12 2011 Rajith Attapattu - 0:0.7.946106-14 -- Applied patches for BZ 667428, 656488. - -* Wed Nov 10 2010 Rajith Attapattu - 0:0.7.946106-12 -- Applied patches for BZ 645855 - -* Tue Oct 12 2010 Rajith Attapattu - 0:0.7.946106-11 -- Added "Obsoletes: qpid-java-qman <= 0.5.751061-9.el5" to the spec file. - -* Wed Sep 22 2010 Rajith Attapattu - 0:0.7.946106-10 -- Applied patches for BZ 634794, 636097, 633969. - -* Mon Sep 13 2010 Rajith Attapattu - 0:0.7.946106-9 -- Applied patches for BZ 626859. - -* Mon Aug 30 2010 Rajith Attapattu - 0:0.7.946106-8 -- Applied patches for BZ 620808, 621395, 622619. - -* Thu Jul 29 2010 Rajith Attapattu - 0:0.7.946106-7 -- Applied patches for BZ 616457, 614580, 618865, 618822, 614589, 513426, 619242. - -* Mon Jul 12 2010 Rajith Attapattu - 0:0.7.946106-6 -- Applied patches for bz612531, bz612526, bz612535. - -* Wed Jun 30 2010 Rajith Attapattu - 0:0.7.946106-5 -- Patches are now generated from git. -- Added a fix for bz608052 -- Configured the javac target to 1.5 for dependencies - -* Tue Jun 15 2010 Rajith Attapattu - 0:0.7.946106-4 -- For dependencies that are not available as rpms, they are now built from source. -- For commons lang, the required classes are now added as a patch, removing the required dependency. - -* Mon May 24 2010 Rajith Attapattu - 0:0.7.946106-3 -- Fixed an error in the run_example script -- Added LICENSE and NOTICE to common rpm - -* Mon May 24 2010 Rajith Attapattu - 0:0.7.946106-2 -- Added Drain and Spout examples -- Removed dependency from sl4j rpm, instead using the jar in qpid-deps - -* Thu May 20 2010 Rajith Attapattu - 0:0.7.946106-1 -- Updated to rev 946106 of Qpid trunk - -* Thu Apr 15 2010 Rajith Attapattu - 0:0.7.934605-1 -- Updated to rev 934605 of Qpid trunk - -* Tue Mar 2 2010 Rajith Attapattu - 0:0.7.918215-1 -- Updated to rev 918215 of Qpid trunk - -* Wed Feb 3 2010 Rajith Attapattu - 0:0.7.906145-1 -- Updated to rev 906145 of Qpid trunk -- Stripped the qman package. The java broker is also not built anymore. - -* Fri Oct 9 2009 Rajith Attapattu - 0:0.5.751061-9 -- Removing patch attached to bz494630 -- Applying patch attached to bz493559 -- Applying patch attached to bz509395 - -* Tue Jun 25 2009 Rajith Attapattu - 0:0.5.751061-8 -- Applying patch attached to bz506739 -- Applying patch attached to bz507369 - -* Mon Jun 8 2009 Rafael Schloming - 0:0.5.751061-7 -- Applying the heartbeat echo patch from bz504590 - -* Thu Jun 04 2009 Rajith Attapattu - 0:0.5.751061-6 -- Applying the modified patch attached to bz503539 - -* Wed Jun 03 2009 Rajith Attapattu - 0:0.5.751061-5 -- Applying patch attached to bz503526 -- Applying patch attached to bz503539 - -* Thu May 21 2009 Rajith Attapattu - 0:0.5.751061-4 -- Fixed an error in the spec file to apply all patches correctly - -* Wed May 20 2009 Rajith Attapattu - 0:0.5.751061-3 -- Applying patch attached to bz500146 -- Applying patch attached to bz501552 - -* Wed Apr 8 2009 Rajith Attapattu - 0:0.5.751061-2 -- Going back to revision 751061 of Qpid trunk -- Applying patch attached to bz494630 - -* Fri Mar 27 2009 Rajith Attapattu - 0:0.5.758820-1 -- Updated to revision 758820 of the Qpid trunk - -* Thu Mar 12 2009 Rajith Attapattu - 0:0.5.751061-1 -- Updated to revision 751061 of the Qpid trunk - -* Wed Mar 04 2009 Rajith Attapattu - 0:0.4.750205-1 -- Updated to revision 750205 of the Qpid trunk - -* Fri Feb 13 2009 Rajith Attapattu - 0:0.4.743367-1 -- Updated to revision 743367 of the Qpid trunk - -* Mon Feb 09 2009 Rajith Attapattu - 0:0.4.742278-1 -- Updated to revision 742278 of the Qpid trunk - -* Wed Jan 28 2009 Rajith Attapattu - 0:0.4.738568-1 -- Updated to revision 738568 of the Qpid trunk -- Removed thread patch as it's comitted to trunk - -* Fri Jan 9 2009 Rajith Attapattu - 0:0.3.733043-2 -- Updated to revision 733043 of the Qpid M4-RCs branch - -* Mon Nov 19 2008 Rajith Attapattu - 0:0.3.724504-1 -- Updated to revision 724504 of the qpid trunk -- Added the Qman package -- Applied the thread abstraction patch - -* Mon Nov 10 2008 Rajith Attapattu - 0:0.3.712662-1 -- Updated to revision 712662 of the qpid trunk - -* Fri Oct 31 2008 Nuno Santos - 0:0.3.709187-1 -- Rebased to svn rev 709187 - -* Mon Oct 28 2008 Rajith Attapattu - 0:0.3.708221-1 -- Updated to revision 708221 of the qpid trunk - -* Fri Aug 25 2008 Justin Ross - 0:0.2.687156-1 -- Updated to revision 687156 of the qpid.0-10 branch - -* Fri Aug 15 2008 Justin Ross - 0:0.2.686136-1 -- Updated to revision 686136 of the qpid.0-10 branch - -* Mon Jun 16 2008 Justin Ross - 0:0.2.668333-1 -- Updated to source revision 668333 - -* Fri Jun 13 2008 Arnaud Simon - 0:0.2.667615-1 -- Updated to source revision 667615 - -* Mon Jun 11 2008 Arnaud Simon - 0:0.2.666296-2 -- Updated common dep and removed package broker - -* Mon Jun 10 2008 Justin Ross - 0:0.2.666296-1 -- Updated to source revision 666296 - -* Mon Jun 9 2008 Arnaud Simon - 0:0.2.665769-1 -- Updated to source revision 665769 - -* Thu May 15 2008 Justin Ross - 0:0.2.656760-1 -- Updated source tarballs instructions -- Added svn revision number to version -- Updated to source revision 656760 - -* Tue May 13 2008 Arnaud Simon - 0:0.2-11 -- changed version for solving version conflic - -* Tue May 13 2008 Arnaud Simon - 0:0.2-10 -- changed some default network configuration - -* Tue May 13 2008 Arnaud Simon - 0:0.2-9 -- Bumped release for Beta 4 - -* Fri Feb 15 2008 Rafael Schloming - 0:0.2-9 -- fix for deadlock exposed by TCK - -* Wed Feb 13 2008 Rafael Schloming - 0:0.2-8 -- More bug fixes for Beta 3 - -* Tue Feb 12 2008 Rafael Schloming - 0:0.2-7 -- Bumped release for Beta 3 bug fixes - -* Mon Feb 11 2008 Rafael Schloming - 0:0.2-6 -- Bumped release for Beta 3 - -* Mon Feb 11 2008 Nuno Santos - 0.2-5 -- Initial build. - diff --git a/rpms/awips2.qpid/0.18/SPECS/qpid-java.spec.patch0 b/rpms/awips2.qpid/0.18/SPECS/qpid-java.spec.patch0 deleted file mode 100644 index 2353119583..0000000000 --- a/rpms/awips2.qpid/0.18/SPECS/qpid-java.spec.patch0 +++ /dev/null @@ -1,319 +0,0 @@ -diff -crB a/qpid-java.spec b/qpid-java.spec -*** a/qpid-java.spec 2013-09-16 16:26:10.000000000 -0500 ---- b/qpid-java.spec 2013-09-16 16:25:55.000000000 -0500 -*************** -*** 1,6 **** -! Name: qpid-java - Version: 0.18 -! Release: 2%{?dist} - Summary: Java implementation of Apache Qpid - License: Apache Software License - Group: Development/Java ---- 1,8 ---- -! %define _awips2_directory "/awips2/qpid" -! -! Name: awips2-qpid-java - Version: 0.18 -! Release: 5%{?dist} - Summary: Java implementation of Apache Qpid - License: Apache Software License - Group: Development/Java -*************** -*** 12,21 **** ---- 14,32 ---- - Source0: %{qpid_src_dir}.tar.gz - Source1: qpid-build-deps-%{version}.tar.gz - Source2: %{qpid_deps_src_dir}.tar.gz -+ Source3: config.xml -+ Source4: virtualhosts.xml -+ Source5: qpidd -+ Source6: log4j.xml -+ Source7: qpid-wrapper -+ Source8: wrapper.conf -+ Source9: yajsw-distribution.tar - - Patch0: mrg.patch - Patch1: examples.patch - Patch2: build.patch -+ Patch3: awips.patch -+ Patch4: qpid-messageNotFound.patch - - BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) - BuildArch: noarch -*************** -*** 35,45 **** - %description common - Java implementation of Apache Qpid - common files - - %package client - Summary: Java implementation of Apache Qpid - client - Group: Development/Java - BuildArch: noarch -! Requires: qpid-java-common = %{version}-%{release} - Requires: log4j >= 1.2.12 - - %description client ---- 46,65 ---- - %description common - Java implementation of Apache Qpid - common files - -+ %package broker -+ Summary: Java implementation of Apache Qpid - broker files -+ Group: Development/Java -+ BuildArch: noarch -+ Provides: awips2-base-component -+ -+ %description broker -+ Java implementation of Apache Qpid - broker files -+ - %package client - Summary: Java implementation of Apache Qpid - client - Group: Development/Java - BuildArch: noarch -! Requires: awips2-qpid-java-common = %{version}-%{release} - Requires: log4j >= 1.2.12 - - %description client -*************** -*** 49,55 **** - Summary: Java implementation of Apache Qpid - example - Group: Development/Java - BuildArch: noarch -! Requires: qpid-java-client = %{version}-%{release} - - %description example - Java implementation of Apache Qpid - example ---- 69,75 ---- - Summary: Java implementation of Apache Qpid - example - Group: Development/Java - BuildArch: noarch -! Requires: awips2-qpid-java-client = %{version}-%{release} - - %description example - Java implementation of Apache Qpid - example -*************** -*** 58,67 **** ---- 78,103 ---- - %setup -q -n %{qpid_src_dir} - mkdir -p java/lib/required - tar -xvzf %SOURCE1 -C java/lib/required -+ # copy baseline libraries and other libraries to required -+ for dependency in `cat %{_topdir}/SOURCES/awips2/dependencies.txt`; -+ do -+ cp -f %{_baseline_workspace}/${dependency} java/lib/required -+ if [ $? -ne 0 ]; then -+ exit 1 -+ fi -+ done -+ # copy dependencies that are not native to the baseline to required -+ cp -f %{_topdir}/SOURCES/awips2/*.jar %{_topdir}/SOURCES/awips2/*.war java/lib/required -+ if [ $? -ne 0 ]; then -+ exit 1 -+ fi - - %patch0 -p2 - %patch1 -p2 - %patch2 -p2 -+ # apply the awips patch -+ %patch3 -p2 -+ %patch4 -p2 - - %setup -q -T -b 2 -n %{qpid_deps_src_dir} - -*************** -*** 70,76 **** - - ( - cd %{qpid_src_dir}/java -! ant -Dretrieve.dependencies=false -Dmodules=common\ client - - # blacklisted jars are either provided by the Requires: or not needed. - BLACKLIST="slf4j qpid-client-tests qpid-all qpid-common-tests" ---- 106,120 ---- - - ( - cd %{qpid_src_dir}/java -! for module in ${QPID_MODULES[*]}; do -! ant -Dretrieve.dependencies=false \ -! -Dmodules=${module} -! done -! ant -Dretrieve.dependencies=false \ -! -Dmodules=common\ client\ amqp-1-0-common\ amqp-1-0-client\ amqp-1-0-client-jms\ management/common\ broker\ jca\ systests\ broker-plugins/access-control\ broker-plugins/firewall\ broker-plugins/management-http\ broker-plugins/management-jmx -! if [ $? -ne 0 ]; then -! exit 1 -! fi - - # blacklisted jars are either provided by the Requires: or not needed. - BLACKLIST="slf4j qpid-client-tests qpid-all qpid-common-tests" -*************** -*** 84,130 **** - - cd .. - -! install -dm 755 %{buildroot}%{_javadir} -! install -pm 644 %{qpid_src_dir}/java/build/lib/qpid-client-%{version}.jar %{buildroot}%{_javadir} -! install -pm 644 %{qpid_src_dir}/java/build/lib/qpid-client-%{version}-sources.jar %{buildroot}%{_javadir} -! install -pm 644 %{qpid_src_dir}/java/build/lib/qpid-common-%{version}.jar %{buildroot}%{_javadir} -! install -pm 644 %{qpid_src_dir}/java/build/lib/qpid-common-%{version}-sources.jar %{buildroot}%{_javadir} -! -! install -dm 755 %{buildroot}%{_javadir}/qpid-deps -! install -pm 644 %{qpid_src_dir}/java/build/lib/log4j-slf4j.jar %{buildroot}%{_javadir}/qpid-deps -! install -pm 644 %{qpid_src_dir}/java/build/lib/qpid-deps-%{version}.jar %{buildroot}%{_javadir}/qpid-deps - - # examples - -! install -dm 755 %{buildroot}%{_docdir}/%{name}-%{version}/examples/org/apache/qpid/example/ - install -pm 644 %{qpid_src_dir}/java/client/example/src/main/java/org/apache/qpid/example/*.java \ -! %{buildroot}%{_docdir}/%{name}-%{version}/examples/org/apache/qpid/example/ - install -pm 644 %{qpid_src_dir}/java/client/example/src/main/java/org/apache/qpid/example/hello.properties \ -! %{buildroot}%{_docdir}/%{name}-%{version}/examples/org/apache/qpid/example/ - install -pm 644 %{qpid_src_dir}/java/client/example/example.log4j \ -! %{buildroot}%{_docdir}/%{name}-%{version}/examples/ - install -pm 755 %{qpid_src_dir}/java/client/example/bin/run_example.sh \ -! %{buildroot}%{_docdir}/%{name}-%{version}/examples/ - - %clean - rm -rf %{buildroot} - - %files common -! %defattr(-,root,root,-) -! %{_javadir}/qpid-deps/ -! %{_javadir}/qpid-common-%{version}.jar -! %{_javadir}/qpid-common-%{version}-sources.jar -! %doc ../%{qpid_src_dir}/java/resources/LICENSE -! %doc ../%{qpid_src_dir}/java/resources/NOTICE - - %files client -! %defattr(-,root,root,-) -! %{_javadir}/qpid-client-%{version}.jar -! %{_javadir}/qpid-client-%{version}-sources.jar - - %files example -! %defattr(-,root,root,-) -! %{_docdir}/%{name}-%{version}/examples/ - - %changelog - * Thu Sep 6 2012 Irina Boverman - 0.18-2 ---- 128,249 ---- - - cd .. - -! install -dm 755 %{buildroot}%{_awips2_directory}/lib/opt -! install -pm 644 %{qpid_src_dir}/java/build/lib/qpid-client-%{version}.jar \ -! %{buildroot}%{_awips2_directory}/lib/opt -! install -pm 644 %{qpid_src_dir}/java/build/lib/qpid-common-%{version}.jar \ -! %{buildroot}%{_awips2_directory}/lib/opt -! install -pm 644 %{qpid_src_dir}/java/build/lib/qpid-broker-%{version}.jar \ -! %{buildroot}%{_awips2_directory}/lib/opt -! install -pm 644 %{qpid_src_dir}/java/build/lib/qpid-management-common-%{version}.jar \ -! %{buildroot}%{_awips2_directory}/lib/opt -! install -pm 644 %{qpid_src_dir}/java/build/lib/plugins/qpid-broker-plugins-management-jmx-%{version}.jar \ -! %{buildroot}%{_awips2_directory}/lib/opt -! install -pm 644 %{qpid_src_dir}/java/build/lib/plugins/qpid-broker-plugins-access-control-%{version}.jar \ -! %{buildroot}%{_awips2_directory}/lib/opt -! install -pm 644 %{qpid_src_dir}/java/build/lib/plugins/qpid-broker-plugins-firewall-%{version}.jar \ -! %{buildroot}%{_awips2_directory}/lib/opt -! install -pm 644 %{qpid_src_dir}/java/build/lib/plugins/qpid-broker-plugins-management-http-%{version}.jar \ -! %{buildroot}%{_awips2_directory}/lib/opt -! -! # scripts for broker -! install -dm 755 %{buildroot}%{_awips2_directory}/bin -! install -pm 644 %{qpid_src_dir}/java/build/bin/* %{buildroot}%{_awips2_directory}/bin -! # install the wrapper script -! install -pm 644 %SOURCE7 %{buildroot}%{_awips2_directory}/bin -! # add the yajsw distribution -! tar -xf %SOURCE9 -C %{buildroot}%{_awips2_directory}/bin -! -! # wrapper configuration -! install -dm 755 %{buildroot}%{_awips2_directory}/conf -! install -pm 644 %SOURCE8 %{buildroot}%{_awips2_directory}/conf -! -! # service script -! mkdir -p %{buildroot}/etc/init.d -! install -pm 755 %SOURCE5 %{buildroot}/etc/init.d -! # logs directory -! mkdir -p %{buildroot}%{_awips2_directory}/log -! -! # qpid configuration -! install -dm 755 %{buildroot}%{_awips2_directory}/etc -! install -pm 644 %{qpid_src_dir}/java/broker/etc/* \ -! %{buildroot}%{_awips2_directory}/etc -! # overwrite the default configuration with the AWIPS II configuration -! install -pm 644 %SOURCE3 %{buildroot}%{_awips2_directory}/etc -! install -pm 644 %SOURCE4 %{buildroot}%{_awips2_directory}/etc -! -! # overwrite the default log4j configuration with the AWIPS II log4j configuration -! install -pm 644 %SOURCE6 %{buildroot}%{_awips2_directory}/etc -! -! # foss dependencies -! install -dm 755 %{buildroot}%{_awips2_directory}/lib/opt/qpid-deps -! install -pm 644 %{qpid_src_dir}/java/lib/required/*.jar \ -! %{buildroot}%{_awips2_directory}/lib/opt/qpid-deps -! -! # license & notice -! install -pm 644 %{qpid_src_dir}/java/resources/LICENSE \ -! %{buildroot}%{_awips2_directory} -! install -pm 644 %{qpid_src_dir}/java/resources/NOTICE \ -! %{buildroot}%{_awips2_directory} - - # examples - -! install -dm 755 %{buildroot}%{_awips2_directory}/doc/%{name}-%{version}/examples/org/apache/qpid/example/ - install -pm 644 %{qpid_src_dir}/java/client/example/src/main/java/org/apache/qpid/example/*.java \ -! %{buildroot}%{_awips2_directory}/doc/%{name}-%{version}/examples/org/apache/qpid/example/ - install -pm 644 %{qpid_src_dir}/java/client/example/src/main/java/org/apache/qpid/example/hello.properties \ -! %{buildroot}%{_awips2_directory}/doc/%{name}-%{version}/examples/org/apache/qpid/example/ - install -pm 644 %{qpid_src_dir}/java/client/example/example.log4j \ -! %{buildroot}%{_awips2_directory}/doc/%{name}-%{version}/examples/ - install -pm 755 %{qpid_src_dir}/java/client/example/bin/run_example.sh \ -! %{buildroot}%{_awips2_directory}/doc/%{name}-%{version}/examples/ - - %clean - rm -rf %{buildroot} - - %files common -! %defattr(-,awips,fxalpha,-) -! %dir /awips2/qpid -! %dir /awips2/qpid/lib -! %dir /awips2/qpid/lib/opt -! /awips2/qpid/lib/opt/qpid-common-%{version}.jar -! /awips2/qpid/lib/opt/qpid-management-common-%{version}.jar -! %dir /awips2/qpid/lib/opt/qpid-deps -! /awips2/qpid/lib/opt/qpid-deps/* -! %doc /awips2/qpid/LICENSE -! %doc /awips2/qpid/NOTICE - - %files client -! %defattr(-,awips,fxalpha,-) -! %dir /awips2/qpid -! %dir /awips2/qpid/lib -! %dir /awips2/qpid/lib/opt -! /awips2/qpid/lib/opt/qpid-client-%{version}.jar -! -! %files broker -! %defattr(-,awips,fxalpha,-) -! %dir /awips2/qpid -! %dir /awips2/qpid/lib -! %dir /awips2/qpid/lib/opt -! /awips2/qpid/lib/opt/qpid-broker-%{version}.jar -! /awips2/qpid/lib/opt/qpid-broker-plugins-management-jmx-%{version}.jar -! /awips2/qpid/lib/opt/qpid-broker-plugins-access-control-%{version}.jar -! /awips2/qpid/lib/opt/qpid-broker-plugins-firewall-%{version}.jar -! /awips2/qpid/lib/opt/qpid-broker-plugins-management-http-%{version}.jar -! %dir /awips2/qpid/log -! %dir /awips2/qpid/conf -! /awips2/qpid/conf/* -! %defattr(755,awips,fxalpha,755) -! %dir /awips2/qpid/bin -! /awips2/qpid/bin/* -! %dir /awips2/qpid/etc -! /awips2/qpid/etc/* -! %defattr(755,root,root,755) -! /etc/init.d/qpidd - - %files example -! %defattr(-,awips,fxalpha,-) -! /awips2/qpid/doc/%{name}-%{version}/examples/ - - %changelog - * Thu Sep 6 2012 Irina Boverman - 0.18-2 diff --git a/rpms/awips2.qpid/0.18/SPECS/qpid-lib.spec b/rpms/awips2.qpid/0.18/SPECS/qpid-lib.spec deleted file mode 100644 index bc14be38d6..0000000000 --- a/rpms/awips2.qpid/0.18/SPECS/qpid-lib.spec +++ /dev/null @@ -1,122 +0,0 @@ -%define _build_arch %(uname -i) -%define _qpid_version 0.18 -%define _qpid_build_loc %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) -%global qpid_src_dir qpid-%{version} -# -# AWIPS II QPID native Spec File -# - -Name: awips2-qpid-lib -Summary: AWIPS II QPID Native Library Distribution -Version: %{_qpid_version} -Release: 1.el6 -Group: AWIPSII -BuildRoot: %{_build_root} -BuildArch: %{_build_arch} -URL: N/A -License: N/A -Distribution: N/A -Vendor: Raytheon -Packager: Bryan Kowal - -Source0: %{qpid_src_dir}.tar.gz - -AutoReq: no -BuildRequires: awips2-python -provides: awips2-qpid-lib - -%description -AWIPS II QPID Lib Distribution - Contains the qpid shared libraries and -header files for qpid %{_qpid_version}. - -%prep -# Ensure that a "buildroot" has been specified. -if [ "%{_build_root}" = "" ]; then - echo "ERROR: A BuildRoot has not been specified." - echo "FATAL: Unable to Continue ... Terminating." - exit 1 -fi - -if [ -d %{_build_root} ]; then - rm -rf %{_build_root} -fi -if [ -d %{_qpid_build_loc} ]; then - rm -rf %{_qpid_build_loc} -fi -mkdir -p %{_qpid_build_loc} -if [ $? -ne 0 ]; then - exit 1 -fi - -cp -v %SOURCE0 %{_qpid_build_loc} -if [ $? -ne 0 ]; then - exit 1 -fi - -pushd . > /dev/null 2>&1 -cd %{_qpid_build_loc} -tar -xvf %SOURCE0 -if [ $? -ne 0 ]; then - exit 1 -fi -popd > /dev/null 2>&1 - -%build -pushd . > /dev/null 2>&1 -cd %{_qpid_build_loc}/%{qpid_src_dir}/cpp -./bootstrap -if [ $? -ne 0 ]; then - exit 1 -fi - -./configure --prefix=%{_qpid_build_loc}/awips2/qpid --without-sasl -if [ $? -ne 0 ]; then - exit 1 -fi -make -if [ $? -ne 0 ]; then - exit 1 -fi -popd > /dev/null 2>&1 - -%install -/bin/mkdir -p %{_qpid_build_loc}/awips2/qpid -if [ $? -ne 0 ]; then - exit 1 -fi - -pushd . > /dev/null 2>&1 -cd %{_qpid_build_loc}/%{qpid_src_dir}/cpp -make install -if [ $? -ne 0 ]; then - exit 1 -fi -popd > /dev/null 2>&1 - -/bin/mkdir -p %{_build_root}/awips2/qpid -if [ $? -ne 0 ]; then - exit 1 -fi - -# copy qpid lib and include directories. -/bin/cp -rv %{_qpid_build_loc}/awips2/qpid/lib \ - %{_build_root}/awips2/qpid -/bin/cp -rv %{_qpid_build_loc}/awips2/qpid/include \ - %{_build_root}/awips2/qpid - -%pre -%post -%preun -%postun - -%clean -rm -rf ${RPM_BUILD_ROOT} -rm -rf %{_qpid_build_loc} - -%files -%defattr(644,awips,fxalpha,755) -%dir /awips2/qpid -%dir /awips2/qpid/lib -/awips2/qpid/lib/* -%dir /awips2/qpid/include -/awips2/qpid/include/* diff --git a/rpms/awips2.qpid/0.18/deploy.builder/build.sh b/rpms/awips2.qpid/0.18/deploy.builder/build.sh deleted file mode 100644 index d3617abcce..0000000000 --- a/rpms/awips2.qpid/0.18/deploy.builder/build.sh +++ /dev/null @@ -1,73 +0,0 @@ -#!/bin/bash - -# Verify that the workspace has been specified -if [ -z ${WORKSPACE} ]; then - echo "Error: the location of the baseline workspace must be specified using the WORKSPACE environment variable." - exit 1 -fi -if [ -z ${AWIPSII_BUILD_ROOT} ]; then - export AWIPSII_BUILD_ROOT="/tmp/${USER}/awips-component" - echo "INFO: using default build root - ${AWIPSII_BUILD_ROOT}." -fi - -__SPECS=qpid-java.spec -__SPECS_PATCH0=qpid-java.spec.patch0 - -# apply the rpm specification patch -cd ../SPECS -if [ $? -ne 0 ]; then - exit 1 -fi -patch -p1 -i ${__SPECS_PATCH0} -if [ $? -ne 0 ]; then - exit 1 -fi - -pushd . > /dev/null -cd ../ -export TOPDIR=`pwd` - -# create the rpm directory structure -if [ -d ${TOPDIR}/BUILD ]; then - rm -rf ${TOPDIR}/BUILD - if [ $? -ne 0 ]; then - exit 1 - fi -fi -mkdir ${TOPDIR}/BUILD -if [ -d ${TOPDIR}/RPMS ]; then - rm -rf ${TOPDIR}/RPMS - if [ $? -ne 0 ]; then - exit 1 - fi -fi -mkdir ${TOPDIR}/RPMS -if [ -d ${TOPDIR}/SRPMS ]; then - rm -rf ${TOPDIR}/SRPMS - if [ $? -ne 0 ]; then - exit 1 - fi -fi -mkdir ${TOPDIR}/SRPMS - -# build the rpm -rpmbuild -ba \ - --define "_topdir ${TOPDIR}" \ - --define "_baseline_workspace ${WORKSPACE}" \ - SPECS/${__SPECS} -if [ $? -ne 0 ]; then - exit 1 -fi -rpmbuild -ba \ - --define "_topdir ${TOPDIR}" \ - --define "_baseline_workspace ${WORKSPACE}" \ - --define "_build_root ${AWIPSII_BUILD_ROOT}" \ - --buildroot ${AWIPSII_BUILD_ROOT} \ - SPECS/qpid-lib.spec -if [ $? -ne 0 ]; then - exit 1 -fi - -popd > /dev/null - -exit 0 diff --git a/rpms/awips2.qpid/0.28/SOURCES/awips.patch b/rpms/awips2.qpid/0.28/SOURCES/awips.patch deleted file mode 100644 index cffc97fbc9..0000000000 --- a/rpms/awips2.qpid/0.28/SOURCES/awips.patch +++ /dev/null @@ -1,68 +0,0 @@ -diff -crB a/qpid/java/build.deps b/qpid/java/build.deps -*** a/qpid/java/build.deps 2014-04-13 09:12:12.000000000 -0500 ---- b/qpid/java/build.deps 2014-10-28 09:14:30.121201558 -0500 -*************** -*** 17,29 **** - # under the License. - # - -! commons-beanutils-core=lib/required/commons-beanutils-core-1.8.3.jar - commons-cli=lib/required/commons-cli-1.2.jar -! commons-codec=lib/required/commons-codec-1.6.jar - commons-collections=lib/required/commons-collections-3.2.1.jar - commons-configuration=lib/required/commons-configuration-1.8.jar - commons-digester=lib/required/commons-digester-1.8.1.jar -! commons-lang=lib/required/commons-lang-2.6.jar - commons-logging=lib/required/commons-logging-1.1.1.jar - - bcel=lib/required/bcel-5.2.jar ---- 17,29 ---- - # under the License. - # - -! commons-beanutils-core=lib/required/commons-beanutils-1.8.3.jar - commons-cli=lib/required/commons-cli-1.2.jar -! commons-codec=lib/required/commons-codec-1.4.jar - commons-collections=lib/required/commons-collections-3.2.1.jar - commons-configuration=lib/required/commons-configuration-1.8.jar - commons-digester=lib/required/commons-digester-1.8.1.jar -! commons-lang=lib/required/commons-lang-2.3.jar - commons-logging=lib/required/commons-logging-1.1.1.jar - - bcel=lib/required/bcel-5.2.jar -*************** -*** 35,41 **** - geronimo-jta=lib/required/geronimo-jta_1.1_spec-1.1.1.jar - geronimo-kernel=lib/required/geronimo-kernel-2.2.1.jar - geronimo-openejb=lib/required/geronimo-ejb_3.0_spec-1.0.1.jar -! geronimo-servlet=lib/required/geronimo-servlet_3.0_spec-1.0.jar - - junit=lib/required/junit-3.8.1.jar - mockito-all=lib/required/mockito-all-1.9.0.jar ---- 35,41 ---- - geronimo-jta=lib/required/geronimo-jta_1.1_spec-1.1.1.jar - geronimo-kernel=lib/required/geronimo-kernel-2.2.1.jar - geronimo-openejb=lib/required/geronimo-ejb_3.0_spec-1.0.1.jar -! geronimo-servlet=lib/required/geronimo-servlet_2.5_spec-1.1.2.jar - - junit=lib/required/junit-3.8.1.jar - mockito-all=lib/required/mockito-all-1.9.0.jar -*************** -*** 60,67 **** - dojo-version=1.9.1 - dojo=lib/required/dojo-${dojo-version}.zip - -! jackson-core=lib/required/jackson-core-asl-1.9.0.jar -! jackson-mapper=lib/required/jackson-mapper-asl-1.9.0.jar - - commons-configuration.libs = ${commons-beanutils-core} ${commons-digester} \ - ${commons-codec} ${commons-lang} ${commons-collections} ${commons-configuration} ---- 60,67 ---- - dojo-version=1.9.1 - dojo=lib/required/dojo-${dojo-version}.zip - -! jackson-core=lib/required/jackson-core-asl-1.7.3.jar -! jackson-mapper=lib/required/jackson-mapper-asl-1.7.3.jar - - commons-configuration.libs = ${commons-beanutils-core} ${commons-digester} \ - ${commons-codec} ${commons-lang} ${commons-collections} ${commons-configuration} diff --git a/rpms/awips2.qpid/0.28/SOURCES/awips2/bcel-5.2.jar b/rpms/awips2.qpid/0.28/SOURCES/awips2/bcel-5.2.jar deleted file mode 100644 index 2fa90cebdc..0000000000 Binary files a/rpms/awips2.qpid/0.28/SOURCES/awips2/bcel-5.2.jar and /dev/null differ diff --git a/rpms/awips2.qpid/0.28/SOURCES/awips2/commons-configuration-1.8.jar b/rpms/awips2.qpid/0.28/SOURCES/awips2/commons-configuration-1.8.jar deleted file mode 100644 index ae9ae9969b..0000000000 Binary files a/rpms/awips2.qpid/0.28/SOURCES/awips2/commons-configuration-1.8.jar and /dev/null differ diff --git a/rpms/awips2.qpid/0.28/SOURCES/awips2/commons-logging-1.1.2.jar b/rpms/awips2.qpid/0.28/SOURCES/awips2/commons-logging-1.1.2.jar deleted file mode 100644 index d6a543c4ed..0000000000 Binary files a/rpms/awips2.qpid/0.28/SOURCES/awips2/commons-logging-1.1.2.jar and /dev/null differ diff --git a/rpms/awips2.qpid/0.28/SOURCES/awips2/dependencies.txt b/rpms/awips2.qpid/0.28/SOURCES/awips2/dependencies.txt deleted file mode 100644 index fde8341425..0000000000 --- a/rpms/awips2.qpid/0.28/SOURCES/awips2/dependencies.txt +++ /dev/null @@ -1,10 +0,0 @@ -org.apache.commons.cli/commons-cli-1.2.jar -org.apache.commons.beanutils/commons-beanutils-1.8.3.jar -org.apache.commons.digester/commons-digester-1.8.1.jar -org.apache.commons.codec/commons-codec-1.4.jar -org.apache.commons.lang/commons-lang-2.3.jar -org.apache.commons.collections/commons-collections-3.2.jar -org.apache.commons.digester/commons-digester-1.8.1.jar -org.codehaus.jackson/jackson-core-asl-1.7.3.jar -org.codehaus.jackson/jackson-mapper-asl-1.7.3.jar -org.mockito/mockito-all-1.9.0.jar diff --git a/rpms/awips2.qpid/0.28/SOURCES/awips2/derby.jar b/rpms/awips2.qpid/0.28/SOURCES/awips2/derby.jar deleted file mode 100644 index b59555907a..0000000000 Binary files a/rpms/awips2.qpid/0.28/SOURCES/awips2/derby.jar and /dev/null differ diff --git a/rpms/awips2.qpid/0.28/SOURCES/awips2/dojo-release-1.9.1.zip b/rpms/awips2.qpid/0.28/SOURCES/awips2/dojo-release-1.9.1.zip deleted file mode 100644 index c30299da7c..0000000000 Binary files a/rpms/awips2.qpid/0.28/SOURCES/awips2/dojo-release-1.9.1.zip and /dev/null differ diff --git a/rpms/awips2.qpid/0.28/SOURCES/awips2/geronimo-ejb_3.0_spec-1.0.1.jar b/rpms/awips2.qpid/0.28/SOURCES/awips2/geronimo-ejb_3.0_spec-1.0.1.jar deleted file mode 100644 index 29087f2f46..0000000000 Binary files a/rpms/awips2.qpid/0.28/SOURCES/awips2/geronimo-ejb_3.0_spec-1.0.1.jar and /dev/null differ diff --git a/rpms/awips2.qpid/0.28/SOURCES/awips2/geronimo-j2ee-connector_1.5_spec-2.0.0.jar b/rpms/awips2.qpid/0.28/SOURCES/awips2/geronimo-j2ee-connector_1.5_spec-2.0.0.jar deleted file mode 100644 index 70e7ed4a93..0000000000 Binary files a/rpms/awips2.qpid/0.28/SOURCES/awips2/geronimo-j2ee-connector_1.5_spec-2.0.0.jar and /dev/null differ diff --git a/rpms/awips2.qpid/0.28/SOURCES/awips2/geronimo-jms_1.1_spec-1.1.1.jar b/rpms/awips2.qpid/0.28/SOURCES/awips2/geronimo-jms_1.1_spec-1.1.1.jar deleted file mode 100644 index 4f5e64643a..0000000000 Binary files a/rpms/awips2.qpid/0.28/SOURCES/awips2/geronimo-jms_1.1_spec-1.1.1.jar and /dev/null differ diff --git a/rpms/awips2.qpid/0.28/SOURCES/awips2/geronimo-jta_1.1_spec-1.1.1.jar b/rpms/awips2.qpid/0.28/SOURCES/awips2/geronimo-jta_1.1_spec-1.1.1.jar deleted file mode 100644 index ee9963dfc8..0000000000 Binary files a/rpms/awips2.qpid/0.28/SOURCES/awips2/geronimo-jta_1.1_spec-1.1.1.jar and /dev/null differ diff --git a/rpms/awips2.qpid/0.28/SOURCES/awips2/geronimo-kernel-2.2.1.jar b/rpms/awips2.qpid/0.28/SOURCES/awips2/geronimo-kernel-2.2.1.jar deleted file mode 100644 index 34c46c3183..0000000000 Binary files a/rpms/awips2.qpid/0.28/SOURCES/awips2/geronimo-kernel-2.2.1.jar and /dev/null differ diff --git a/rpms/awips2.qpid/0.28/SOURCES/awips2/jetty-continuation-8.1.14.v20131031.jar b/rpms/awips2.qpid/0.28/SOURCES/awips2/jetty-continuation-8.1.14.v20131031.jar deleted file mode 100644 index 43c75169f4..0000000000 Binary files a/rpms/awips2.qpid/0.28/SOURCES/awips2/jetty-continuation-8.1.14.v20131031.jar and /dev/null differ diff --git a/rpms/awips2.qpid/0.28/SOURCES/awips2/jetty-http-8.1.14.v20131031.jar b/rpms/awips2.qpid/0.28/SOURCES/awips2/jetty-http-8.1.14.v20131031.jar deleted file mode 100644 index 94f7c7c381..0000000000 Binary files a/rpms/awips2.qpid/0.28/SOURCES/awips2/jetty-http-8.1.14.v20131031.jar and /dev/null differ diff --git a/rpms/awips2.qpid/0.28/SOURCES/awips2/jetty-io-8.1.14.v20131031.jar b/rpms/awips2.qpid/0.28/SOURCES/awips2/jetty-io-8.1.14.v20131031.jar deleted file mode 100644 index 75708326b7..0000000000 Binary files a/rpms/awips2.qpid/0.28/SOURCES/awips2/jetty-io-8.1.14.v20131031.jar and /dev/null differ diff --git a/rpms/awips2.qpid/0.28/SOURCES/awips2/jetty-security-8.1.14.v20131031.jar b/rpms/awips2.qpid/0.28/SOURCES/awips2/jetty-security-8.1.14.v20131031.jar deleted file mode 100644 index b03e812837..0000000000 Binary files a/rpms/awips2.qpid/0.28/SOURCES/awips2/jetty-security-8.1.14.v20131031.jar and /dev/null differ diff --git a/rpms/awips2.qpid/0.28/SOURCES/awips2/jetty-server-8.1.14.v20131031.jar b/rpms/awips2.qpid/0.28/SOURCES/awips2/jetty-server-8.1.14.v20131031.jar deleted file mode 100644 index d03aba1007..0000000000 Binary files a/rpms/awips2.qpid/0.28/SOURCES/awips2/jetty-server-8.1.14.v20131031.jar and /dev/null differ diff --git a/rpms/awips2.qpid/0.28/SOURCES/awips2/jetty-servlet-8.1.14.v20131031.jar b/rpms/awips2.qpid/0.28/SOURCES/awips2/jetty-servlet-8.1.14.v20131031.jar deleted file mode 100644 index 1210e620d0..0000000000 Binary files a/rpms/awips2.qpid/0.28/SOURCES/awips2/jetty-servlet-8.1.14.v20131031.jar and /dev/null differ diff --git a/rpms/awips2.qpid/0.28/SOURCES/awips2/jetty-util-8.1.14.v20131031.jar b/rpms/awips2.qpid/0.28/SOURCES/awips2/jetty-util-8.1.14.v20131031.jar deleted file mode 100644 index 6fc403191e..0000000000 Binary files a/rpms/awips2.qpid/0.28/SOURCES/awips2/jetty-util-8.1.14.v20131031.jar and /dev/null differ diff --git a/rpms/awips2.qpid/0.28/SOURCES/awips2/jetty-websocket-8.1.14.v20131031.jar b/rpms/awips2.qpid/0.28/SOURCES/awips2/jetty-websocket-8.1.14.v20131031.jar deleted file mode 100644 index 24e7c3ed94..0000000000 Binary files a/rpms/awips2.qpid/0.28/SOURCES/awips2/jetty-websocket-8.1.14.v20131031.jar and /dev/null differ diff --git a/rpms/awips2.qpid/0.28/SOURCES/awips2/junit-3.8.1.jar b/rpms/awips2.qpid/0.28/SOURCES/awips2/junit-3.8.1.jar deleted file mode 100644 index 674d71e89e..0000000000 Binary files a/rpms/awips2.qpid/0.28/SOURCES/awips2/junit-3.8.1.jar and /dev/null differ diff --git a/rpms/awips2.qpid/0.28/SOURCES/awips2/log4j-1.2.16.jar b/rpms/awips2.qpid/0.28/SOURCES/awips2/log4j-1.2.16.jar deleted file mode 100644 index 5429a903e1..0000000000 Binary files a/rpms/awips2.qpid/0.28/SOURCES/awips2/log4j-1.2.16.jar and /dev/null differ diff --git a/rpms/awips2.qpid/0.28/SOURCES/awips2/slf4j-api-1.6.4.jar b/rpms/awips2.qpid/0.28/SOURCES/awips2/slf4j-api-1.6.4.jar deleted file mode 100644 index 76ef3050fe..0000000000 Binary files a/rpms/awips2.qpid/0.28/SOURCES/awips2/slf4j-api-1.6.4.jar and /dev/null differ diff --git a/rpms/awips2.qpid/0.28/SOURCES/awips2/velocity-1.4.jar b/rpms/awips2.qpid/0.28/SOURCES/awips2/velocity-1.4.jar deleted file mode 100644 index 04ec9d2f85..0000000000 Binary files a/rpms/awips2.qpid/0.28/SOURCES/awips2/velocity-1.4.jar and /dev/null differ diff --git a/rpms/awips2.qpid/0.28/SOURCES/awips2/velocity-dep-1.4.jar b/rpms/awips2.qpid/0.28/SOURCES/awips2/velocity-dep-1.4.jar deleted file mode 100644 index 375712b0e8..0000000000 Binary files a/rpms/awips2.qpid/0.28/SOURCES/awips2/velocity-dep-1.4.jar and /dev/null differ diff --git a/rpms/awips2.qpid/0.28/SOURCES/build.patch b/rpms/awips2.qpid/0.28/SOURCES/build.patch deleted file mode 100644 index 887c5bc150..0000000000 --- a/rpms/awips2.qpid/0.28/SOURCES/build.patch +++ /dev/null @@ -1,19 +0,0 @@ -*** a/qpid/java/build.xml 2014-05-13 04:58:21.000000000 -0500 ---- b/qpid/java/build.xml 2014-10-27 14:53:46.434396511 -0500 -*************** -*** 179,185 **** - - - -! - - - ---- 179,185 ---- - - - -! - - - diff --git a/rpms/awips2.qpid/0.28/SOURCES/examples.patch b/rpms/awips2.qpid/0.28/SOURCES/examples.patch deleted file mode 100644 index 518cb93df5..0000000000 --- a/rpms/awips2.qpid/0.28/SOURCES/examples.patch +++ /dev/null @@ -1,96 +0,0 @@ -From 4acdbf975c076c2c49e7e2436065ca7d18dfab20 Mon Sep 17 00:00:00 2001 -From: rajith -Date: Wed, 16 Jun 2010 16:37:11 -0400 -Subject: [PATCH 02/52] These two files are not present in upstream and we currently carry them as a patch. - The reason being that the run_example.sh is tailored specific for the linux env. - Including the example.log4j depends on how the release artefacts will look like for the 0.7 qpid release. - ---- - qpid/java/client/example/bin/run_example.sh | 43 +++++++++++++++++++++++++++ - qpid/java/client/example/example.log4j | 27 +++++++++++++++++ - 2 files changed, 70 insertions(+), 0 deletions(-) - create mode 100644 qpid/java/client/example/bin/run_example.sh - create mode 100644 qpid/java/client/example/example.log4j - -diff --git a/qpid/java/client/example/bin/run_example.sh b/qpid/java/client/example/bin/run_example.sh -new file mode 100644 -index 0000000..5bd0e99 ---- /dev/null -+++ b/qpid/java/client/example/bin/run_example.sh -@@ -0,0 +1,43 @@ -+#!/bin/bash -+ -+# -+# 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. -+# -+ -+# set the CLASSPATH -+QPID_DEPS=`find /usr/share/java/qpid-deps/*.jar | tr '\n' ":"` -+QPID_JARS=`find /usr/share/java -name 'qpid-client*.jar' -or -name 'qpid-common*.jar' | tr '\n' ":"` -+LOG4J="/usr/share/java/log4j.jar" -+QPID_CLASSPATH=$QPID_DEPS$LOG4J:$QPID_JARS -+ -+# compile the samples -+javac -cp "$QPID_CLASSPATH" -sourcepath "$PWD" -d . `find $PWD -name '*.java'` -+ -+# Add output classes to CLASSPATH -+QPID_CLASSPATH="$PWD:$QPID_CLASSPATH" -+ -+ -+# Check if the user supplied a sample classname -+if test "'x$1'" = "'x'" -+then -+ echo "No sample classname specified" -+ exit; -+else -+ java -cp $QPID_CLASSPATH -Dlog4j.configuration=example.log4j "$@" -+fi -+ -diff --git a/qpid/java/client/example/example.log4j b/qpid/java/client/example/example.log4j -new file mode 100644 -index 0000000..50b4ed2 ---- /dev/null -+++ b/qpid/java/client/example/example.log4j -@@ -0,0 +1,27 @@ -+# -+# 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. -+# -+ -+log4j.logger.org.apache.qpid=WARN, console -+log4j.additivity.org.apache.qpid=false -+ -+ -+log4j.appender.console=org.apache.log4j.ConsoleAppender -+log4j.appender.console.Threshold=all -+log4j.appender.console.layout=org.apache.log4j.PatternLayout -+log4j.appender.console.layout.ConversionPattern=%t %d %p [%c{4}] %m%n diff --git a/rpms/awips2.qpid/0.28/SOURCES/qpid-0.28.tar.gz b/rpms/awips2.qpid/0.28/SOURCES/qpid-0.28.tar.gz deleted file mode 100644 index a772f0f5c6..0000000000 Binary files a/rpms/awips2.qpid/0.28/SOURCES/qpid-0.28.tar.gz and /dev/null differ diff --git a/rpms/awips2.qpid/0.28/SPECS/qpid-java.spec b/rpms/awips2.qpid/0.28/SPECS/qpid-java.spec deleted file mode 100644 index 935ee9037c..0000000000 --- a/rpms/awips2.qpid/0.28/SPECS/qpid-java.spec +++ /dev/null @@ -1,422 +0,0 @@ -%define _awips2_directory "/awips2/qpid" - -Name: awips2-qpid-java -Version: 0.28 -Release: 5%{?dist} -Summary: Java implementation of Apache Qpid -License: Apache Software License -Group: Development/Java -URL: http://qpid.apache.org/ - -%global qpid_src_dir qpid-%{version} -%global qpid_deps_src_dir qpid-deps-%{version} - -Source0: %{qpid_src_dir}.tar.gz - -Patch0: build.patch -Patch1: examples.patch -Patch2: awips.patch - -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) -BuildArch: noarch -BuildRequires: ant >= 1.6.5 -BuildRequires: ant-nodeps >= 1.6.5 -BuildRequires: java-devel >= 1.6.0 -BuildRequires: ant-trax >= 1.6.5 - -%description -Java implementation of Apache Qpid. - -%package common -Summary: Java implementation of Apache Qpid - common files -Group: Development/Java -BuildArch: noarch - -%description common -Java implementation of Apache Qpid - common files - -%package client -Summary: Java implementation of Apache Qpid - client -Group: Development/Java -BuildArch: noarch -Requires: awips2-qpid-java-common = %{version}-%{release} -Requires: log4j >= 1.2.12 - -%description client -Java implementation of Apache Qpid - client - -%package example -Summary: Java implementation of Apache Qpid - example -Group: Development/Java -BuildArch: noarch -Requires: awips2-qpid-java-client = %{version}-%{release} - -%description example -Java implementation of Apache Qpid - example - -%prep -%setup -q -n %{qpid_src_dir} -mkdir -p java/lib/required -# copy baseline libraries and other libraries to required -for dependency in `cat %{_topdir}/SOURCES/awips2/dependencies.txt`; -do - cp -f %{_baseline_workspace}/${dependency} java/lib/required - if [ $? -ne 0 ]; then - exit 1 - fi -done -# copy dependencies that are not native to the baseline to required -cp -f %{_topdir}/SOURCES/awips2/*.jar %{_topdir}/SOURCES/awips2/*.zip java/lib/required -if [ $? -ne 0 ]; then - exit 1 -fi - -%patch0 -p2 -%patch1 -p2 -# apply the awips patch -%patch2 -p2 - -%build -cd .. - -( - cd %{qpid_src_dir}/java - for module in ${QPID_MODULES[*]}; do - ant -Dretrieve.dependencies=false \ - -Dmodules=${module} - done - ant -Dretrieve.dependencies=false \ - -Dmodules=qpid-test-utils\ common\ management/common\ client\ amqp-1-0-common\ amqp-1-0-client\ amqp-1-0-client-jms\ jca - - if [ $? -ne 0 ]; then - exit 1 - fi - - # blacklisted jars are either provided by the Requires: or not needed. - BLACKLIST="slf4j qpid-client-tests qpid-all qpid-common-tests" - for jar in $BLACKLIST; do rm build/lib/${jar}*.jar; done -) - -%install -rm -rf %{buildroot} - -cd .. - -install -dm 755 %{buildroot}%{_awips2_directory}/lib/opt -install -pm 644 %{qpid_src_dir}/java/build/lib/qpid-client-%{version}.jar \ - %{buildroot}%{_awips2_directory}/lib/opt -install -pm 644 %{qpid_src_dir}/java/build/lib/qpid-common-%{version}.jar \ - %{buildroot}%{_awips2_directory}/lib/opt -install -pm 644 %{qpid_src_dir}/java/build/lib/qpid-management-common-%{version}.jar \ - %{buildroot}%{_awips2_directory}/lib/opt - -# foss dependencies -install -dm 755 %{buildroot}%{_awips2_directory}/lib/opt/qpid-deps -install -pm 644 %{qpid_src_dir}/java/lib/required/*.jar \ - %{buildroot}%{_awips2_directory}/lib/opt/qpid-deps - -# license & notice -install -pm 644 %{qpid_src_dir}/java/resources/LICENSE \ - %{buildroot}%{_awips2_directory} -install -pm 644 %{qpid_src_dir}/java/resources/NOTICE \ - %{buildroot}%{_awips2_directory} - -# examples - -install -dm 755 %{buildroot}%{_awips2_directory}/doc/%{name}-%{version}/examples/org/apache/qpid/example/ -install -pm 644 %{qpid_src_dir}/java/client/example/src/main/java/org/apache/qpid/example/*.java \ - %{buildroot}%{_awips2_directory}/doc/%{name}-%{version}/examples/org/apache/qpid/example/ -install -pm 644 %{qpid_src_dir}/java/client/example/src/main/java/org/apache/qpid/example/hello.properties \ - %{buildroot}%{_awips2_directory}/doc/%{name}-%{version}/examples/org/apache/qpid/example/ -install -pm 644 %{qpid_src_dir}/java/client/example/example.log4j \ - %{buildroot}%{_awips2_directory}/doc/%{name}-%{version}/examples/ -install -pm 755 %{qpid_src_dir}/java/client/example/bin/run_example.sh \ - %{buildroot}%{_awips2_directory}/doc/%{name}-%{version}/examples/ - -%clean -rm -rf %{buildroot} - -%files common -%defattr(-,awips,fxalpha,-) -%dir /awips2/qpid -%dir /awips2/qpid/lib -%dir /awips2/qpid/lib/opt -/awips2/qpid/lib/opt/qpid-common-%{version}.jar -/awips2/qpid/lib/opt/qpid-management-common-%{version}.jar -%dir /awips2/qpid/lib/opt/qpid-deps -/awips2/qpid/lib/opt/qpid-deps/* -%doc /awips2/qpid/LICENSE -%doc /awips2/qpid/NOTICE - -%files client -%defattr(-,awips,fxalpha,-) -%dir /awips2/qpid -%dir /awips2/qpid/lib -%dir /awips2/qpid/lib/opt -/awips2/qpid/lib/opt/qpid-client-%{version}.jar - -%files example -%defattr(-,awips,fxalpha,-) -/awips2/qpid/doc/%{name}-%{version}/examples/ - -%changelog -* Thu Sep 6 2012 Irina Boverman - 0.18-2 -- Resolved bz 851574 - -* Tue Jul 10 2012 Justin Ross - 0.18-1 -- Refactored spec file to use standard Qpid source export -- Rebased to Qpid 0.18 beta source - -* Thu Feb 23 2012 Rajith Attapattu - 0:0.14-3 -- Added a patch to account for changes between 0.14-rc1 and HEAD of 0.14-mrg-preview. - -* Thu Feb 16 2012 Rajith Attapattu - 0:0.14-2 -- Added a patch to account for changes between 0.14-rc1 and HEAD of 0.14-mrg-preview. - -* Mon Dec 12 2011 Rajith Attapattu - 0:0.14-1 -- Rebased the client to use the Qpid 0.14 RC1 source. -- Added a patch to account for changes between 0.14-rc1 and HEAD of 0.14-mrg-preview. - -* Fri Sep 23 2011 Andrew Stitcher - 0:0.10-11 -- Added new qpid-java-jca-zip package which wraps a zip of everything - in qpid jca. -- Make qpid-deps jar have correct 0.10 version -- Updated patch to include latest Qpid JCA work: - BZ.738316 - BZ 733383 - BZ 736252 - BZ 700500 - BZ 707535 - BZ 722614 - BZ 735030 - BZ 738615 - BZ 700494 - BZ 705913 - BZ 723714 - BZ 735384 - BZ 736794 - BZ 737880 - BZ 735322 - BZ 736785 - -* Tue Sep 14 2011 Rajith Attapattu - 0:0.10-9 -- Added a patch to account for changes between 0.10 and mrg_2.0.3 head rev on Sep 14th. - -* Mon May 16 2011 Rajith Attapattu - 0:0.10.-6 -- Added a patch to account for changes between 0.10 and qpid-0.10-package-set-7 tags. - -* Thu Apr 28 2011 Andrew Stitcher - 0:0.10.-5 -- Removed jar file that was not meant to be in qpid-java-common - -* Wed Apr 20 2011 Rajith Attapattu - 0:0.10.-4 -- Added a patch to account for changes between 0.10 and qpid-0.10-package-set-5 tags. - -* Thu Apr 14 2011 Ted Ross - 0:0.10-3 -- Added a patch to fix BZ694617 - -* Wed Apr 6 2011 Rajith Attapattu - 0:0.10.-2 -- Added a patch to include QPID-3177 which is included in the upstream 0.10 release. -- Fixed an error in the qpid-deps source tarball. - -* Thu Mar 24 2011 Rajith Attapattu - 0:0.10.-1 -- Change the version from 0.10.1083082 to 0.10. - -* Wed Mar 23 2011 Rajith Attapattu - 0:0.10.1083082-1 -- Updated the source files to rev 1083082 in Qpid 0.10 branch. - -* Thu Mar 10 2011 Andrew Stitcher - 0:0.9.1080013-3 -- Fixed issue that stopped deployment on JBoss 5 -- Added sample deployment resource -- Added some JCA example code -- Added separate Readme for JBoss deployment - -* Thu Mar 10 2011 Andrew Stitcher - 0:0.9.1080013-2 -- Updated JCA package added some documentation to it. -- Add qpid-deps jar into the qpid-ra rar file to supply dependencies for - qpid-common/qpid-client jars - -* Wed Mar 9 2011 Rajith Attapattu - 0:0.9.1080013-1 -- Updated the source files to rev 1080013 in Qpid 0.10 branch. - -* Tue Mar 8 2011 Andrew Stitcher - 0:0.9.1073306-3 -- Changed JCA build to use source for jar dependents - -* Wed Mar 2 2011 Andrew Stitcher - 0:0.9.1073306-2 -- Added new sub-package for JCA resource adapter - -* Thu Feb 24 2011 Rajith Attapattu - 0:0.9.1073306-1 -- Updated the source files to rev 1073306 in Qpid trunk. - -* Thu Jan 27 2011 Rajith Attapattu - 0:0.7.946106-15 -- Applied another patch for BZ 656488, 672212. - -* Wed Jan 12 2011 Rajith Attapattu - 0:0.7.946106-14 -- Applied patches for BZ 667428, 656488. - -* Wed Nov 10 2010 Rajith Attapattu - 0:0.7.946106-12 -- Applied patches for BZ 645855 - -* Tue Oct 12 2010 Rajith Attapattu - 0:0.7.946106-11 -- Added "Obsoletes: qpid-java-qman <= 0.5.751061-9.el5" to the spec file. - -* Wed Sep 22 2010 Rajith Attapattu - 0:0.7.946106-10 -- Applied patches for BZ 634794, 636097, 633969. - -* Mon Sep 13 2010 Rajith Attapattu - 0:0.7.946106-9 -- Applied patches for BZ 626859. - -* Mon Aug 30 2010 Rajith Attapattu - 0:0.7.946106-8 -- Applied patches for BZ 620808, 621395, 622619. - -* Thu Jul 29 2010 Rajith Attapattu - 0:0.7.946106-7 -- Applied patches for BZ 616457, 614580, 618865, 618822, 614589, 513426, 619242. - -* Mon Jul 12 2010 Rajith Attapattu - 0:0.7.946106-6 -- Applied patches for bz612531, bz612526, bz612535. - -* Wed Jun 30 2010 Rajith Attapattu - 0:0.7.946106-5 -- Patches are now generated from git. -- Added a fix for bz608052 -- Configured the javac target to 1.5 for dependencies - -* Tue Jun 15 2010 Rajith Attapattu - 0:0.7.946106-4 -- For dependencies that are not available as rpms, they are now built from source. -- For commons lang, the required classes are now added as a patch, removing the required dependency. - -* Mon May 24 2010 Rajith Attapattu - 0:0.7.946106-3 -- Fixed an error in the run_example script -- Added LICENSE and NOTICE to common rpm - -* Mon May 24 2010 Rajith Attapattu - 0:0.7.946106-2 -- Added Drain and Spout examples -- Removed dependency from sl4j rpm, instead using the jar in qpid-deps - -* Thu May 20 2010 Rajith Attapattu - 0:0.7.946106-1 -- Updated to rev 946106 of Qpid trunk - -* Thu Apr 15 2010 Rajith Attapattu - 0:0.7.934605-1 -- Updated to rev 934605 of Qpid trunk - -* Tue Mar 2 2010 Rajith Attapattu - 0:0.7.918215-1 -- Updated to rev 918215 of Qpid trunk - -* Wed Feb 3 2010 Rajith Attapattu - 0:0.7.906145-1 -- Updated to rev 906145 of Qpid trunk -- Stripped the qman package. The java broker is also not built anymore. - -* Fri Oct 9 2009 Rajith Attapattu - 0:0.5.751061-9 -- Removing patch attached to bz494630 -- Applying patch attached to bz493559 -- Applying patch attached to bz509395 - -* Tue Jun 25 2009 Rajith Attapattu - 0:0.5.751061-8 -- Applying patch attached to bz506739 -- Applying patch attached to bz507369 - -* Mon Jun 8 2009 Rafael Schloming - 0:0.5.751061-7 -- Applying the heartbeat echo patch from bz504590 - -* Thu Jun 04 2009 Rajith Attapattu - 0:0.5.751061-6 -- Applying the modified patch attached to bz503539 - -* Wed Jun 03 2009 Rajith Attapattu - 0:0.5.751061-5 -- Applying patch attached to bz503526 -- Applying patch attached to bz503539 - -* Thu May 21 2009 Rajith Attapattu - 0:0.5.751061-4 -- Fixed an error in the spec file to apply all patches correctly - -* Wed May 20 2009 Rajith Attapattu - 0:0.5.751061-3 -- Applying patch attached to bz500146 -- Applying patch attached to bz501552 - -* Wed Apr 8 2009 Rajith Attapattu - 0:0.5.751061-2 -- Going back to revision 751061 of Qpid trunk -- Applying patch attached to bz494630 - -* Fri Mar 27 2009 Rajith Attapattu - 0:0.5.758820-1 -- Updated to revision 758820 of the Qpid trunk - -* Thu Mar 12 2009 Rajith Attapattu - 0:0.5.751061-1 -- Updated to revision 751061 of the Qpid trunk - -* Wed Mar 04 2009 Rajith Attapattu - 0:0.4.750205-1 -- Updated to revision 750205 of the Qpid trunk - -* Fri Feb 13 2009 Rajith Attapattu - 0:0.4.743367-1 -- Updated to revision 743367 of the Qpid trunk - -* Mon Feb 09 2009 Rajith Attapattu - 0:0.4.742278-1 -- Updated to revision 742278 of the Qpid trunk - -* Wed Jan 28 2009 Rajith Attapattu - 0:0.4.738568-1 -- Updated to revision 738568 of the Qpid trunk -- Removed thread patch as it's comitted to trunk - -* Fri Jan 9 2009 Rajith Attapattu - 0:0.3.733043-2 -- Updated to revision 733043 of the Qpid M4-RCs branch - -* Mon Nov 19 2008 Rajith Attapattu - 0:0.3.724504-1 -- Updated to revision 724504 of the qpid trunk -- Added the Qman package -- Applied the thread abstraction patch - -* Mon Nov 10 2008 Rajith Attapattu - 0:0.3.712662-1 -- Updated to revision 712662 of the qpid trunk - -* Fri Oct 31 2008 Nuno Santos - 0:0.3.709187-1 -- Rebased to svn rev 709187 - -* Mon Oct 28 2008 Rajith Attapattu - 0:0.3.708221-1 -- Updated to revision 708221 of the qpid trunk - -* Fri Aug 25 2008 Justin Ross - 0:0.2.687156-1 -- Updated to revision 687156 of the qpid.0-10 branch - -* Fri Aug 15 2008 Justin Ross - 0:0.2.686136-1 -- Updated to revision 686136 of the qpid.0-10 branch - -* Mon Jun 16 2008 Justin Ross - 0:0.2.668333-1 -- Updated to source revision 668333 - -* Fri Jun 13 2008 Arnaud Simon - 0:0.2.667615-1 -- Updated to source revision 667615 - -* Mon Jun 11 2008 Arnaud Simon - 0:0.2.666296-2 -- Updated common dep and removed package broker - -* Mon Jun 10 2008 Justin Ross - 0:0.2.666296-1 -- Updated to source revision 666296 - -* Mon Jun 9 2008 Arnaud Simon - 0:0.2.665769-1 -- Updated to source revision 665769 - -* Thu May 15 2008 Justin Ross - 0:0.2.656760-1 -- Updated source tarballs instructions -- Added svn revision number to version -- Updated to source revision 656760 - -* Tue May 13 2008 Arnaud Simon - 0:0.2-11 -- changed version for solving version conflic - -* Tue May 13 2008 Arnaud Simon - 0:0.2-10 -- changed some default network configuration - -* Tue May 13 2008 Arnaud Simon - 0:0.2-9 -- Bumped release for Beta 4 - -* Fri Feb 15 2008 Rafael Schloming - 0:0.2-9 -- fix for deadlock exposed by TCK - -* Wed Feb 13 2008 Rafael Schloming - 0:0.2-8 -- More bug fixes for Beta 3 - -* Tue Feb 12 2008 Rafael Schloming - 0:0.2-7 -- Bumped release for Beta 3 bug fixes - -* Mon Feb 11 2008 Rafael Schloming - 0:0.2-6 -- Bumped release for Beta 3 - -* Mon Feb 11 2008 Nuno Santos - 0.2-5 -- Initial build. - diff --git a/rpms/awips2.qpid/0.28/SPECS/qpid-lib.spec b/rpms/awips2.qpid/0.28/SPECS/qpid-lib.spec deleted file mode 100644 index 7f3c392faf..0000000000 --- a/rpms/awips2.qpid/0.28/SPECS/qpid-lib.spec +++ /dev/null @@ -1,127 +0,0 @@ -%define _build_arch %(uname -i) -%define _qpid_version 0.28 -%define _qpid_build_loc %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) -%global qpid_src_dir qpid-%{version} -# -# AWIPS II QPID native Spec File -# - -Name: awips2-qpid-lib -Summary: AWIPS II QPID Native Library Distribution -Version: %{_qpid_version} -Release: 1.el6 -Group: AWIPSII -BuildRoot: %{_build_root} -BuildArch: %{_build_arch} -URL: N/A -License: N/A -Distribution: N/A -Vendor: Raytheon -Packager: Bryan Kowal - -Source0: %{qpid_src_dir}.tar.gz - -AutoReq: no -BuildRequires: awips2-python -provides: awips2-qpid-lib - -%description -AWIPS II QPID Lib Distribution - Contains the qpid shared libraries and -header files for qpid %{_qpid_version}. - -%prep -# Ensure that a "buildroot" has been specified. -if [ "%{_build_root}" = "" ]; then - echo "ERROR: A BuildRoot has not been specified." - echo "FATAL: Unable to Continue ... Terminating." - exit 1 -fi - -if [ -d %{_build_root} ]; then - rm -rf %{_build_root} -fi -if [ -d %{_qpid_build_loc} ]; then - rm -rf %{_qpid_build_loc} -fi -mkdir -p %{_qpid_build_loc} -if [ $? -ne 0 ]; then - exit 1 -fi - -cp -v %SOURCE0 %{_qpid_build_loc} -if [ $? -ne 0 ]; then - exit 1 -fi - -pushd . > /dev/null 2>&1 -cd %{_qpid_build_loc} -tar -xvf %SOURCE0 -if [ $? -ne 0 ]; then - exit 1 -fi -popd > /dev/null 2>&1 - -%build -pushd . > /dev/null 2>&1 - -mkdir -p %{_qpid_build_loc}/build -if [ $? -ne 0 ]; then - exit 1 -fi - -cd %{_qpid_build_loc}/build - -cmake %{_qpid_build_loc}/%{qpid_src_dir}/cpp -DCMAKE_INSTALL_PREFIX:PATH=%{_qpid_build_loc}/awips2/qpid -if [ $? -ne 0 ]; then - exit 1 -fi - -make all -if [ $? -ne 0 ]; then - exit 1 -fi -popd > /dev/null 2>&1 - -%install -/bin/mkdir -p %{_qpid_build_loc}/awips2/qpid -if [ $? -ne 0 ]; then - exit 1 -fi - -pushd . > /dev/null 2>&1 -cd %{_qpid_build_loc}/build -make install -if [ $? -ne 0 ]; then - exit 1 -fi -popd > /dev/null 2>&1 - -/bin/mkdir -p %{_build_root}/awips2/qpid -if [ $? -ne 0 ]; then - exit 1 -fi - -# copy qpid lib and include directories. -/bin/cp -rv %{_qpid_build_loc}/awips2/qpid/lib \ - %{_build_root}/awips2/qpid -/bin/cp -rv %{_qpid_build_loc}/awips2/qpid/lib64/* \ - %{_build_root}/awips2/qpid/lib -/bin/cp -rv %{_qpid_build_loc}/awips2/qpid/include \ - %{_build_root}/awips2/qpid - -%pre -%post -%preun -%postun - -%clean -rm -rf ${RPM_BUILD_ROOT} -rm -rf %{_qpid_build_loc} - -%files -%defattr(644,awips,fxalpha,755) -%dir /awips2/qpid -%dir /awips2/qpid/lib -/awips2/qpid/lib/* -%dir /awips2/qpid/include -/awips2/qpid/include/* diff --git a/rpms/awips2.qpid/0.28/deploy.builder/build.sh b/rpms/awips2.qpid/0.28/deploy.builder/build.sh deleted file mode 100644 index e0c51e4182..0000000000 --- a/rpms/awips2.qpid/0.28/deploy.builder/build.sh +++ /dev/null @@ -1,73 +0,0 @@ -#!/bin/bash -x - -# Verify that the workspace has been specified -if [ -z ${WORKSPACE} ]; then - echo "Error: the location of the baseline workspace must be specified using the WORKSPACE environment variable." - exit 1 -fi -if [ -z ${AWIPSII_BUILD_ROOT} ]; then - export AWIPSII_BUILD_ROOT="/tmp/${USER}/awips-component" - echo "INFO: using default build root - ${AWIPSII_BUILD_ROOT}." -fi - -__SPECS=qpid-java.spec -#__SPECS_PATCH0=qpid-java.spec.patch0 - -# apply the rpm specification patch -#cd ../SPECS -#if [ $? -ne 0 ]; then -# exit 1 -#fi -#patch -p1 -i ${__SPECS_PATCH0} -#if [ $? -ne 0 ]; then -# exit 1 -#fi - -pushd . > /dev/null -cd ../ -export TOPDIR=`pwd` - -# create the rpm directory structure -if [ -d ${TOPDIR}/BUILD ]; then - rm -rf ${TOPDIR}/BUILD - if [ $? -ne 0 ]; then - exit 1 - fi -fi -mkdir ${TOPDIR}/BUILD -if [ -d ${TOPDIR}/RPMS ]; then - rm -rf ${TOPDIR}/RPMS - if [ $? -ne 0 ]; then - exit 1 - fi -fi -mkdir ${TOPDIR}/RPMS -if [ -d ${TOPDIR}/SRPMS ]; then - rm -rf ${TOPDIR}/SRPMS - if [ $? -ne 0 ]; then - exit 1 - fi -fi -mkdir ${TOPDIR}/SRPMS - -# build the rpm -rpmbuild -ba \ - --define "_topdir ${TOPDIR}" \ - --define "_baseline_workspace ${WORKSPACE}" \ - SPECS/${__SPECS} -if [ $? -ne 0 ]; then - exit 1 -fi -rpmbuild -ba \ - --define "_topdir ${TOPDIR}" \ - --define "_baseline_workspace ${WORKSPACE}" \ - --define "_build_root ${AWIPSII_BUILD_ROOT}" \ - --buildroot ${AWIPSII_BUILD_ROOT} \ - SPECS/qpid-lib.spec -if [ $? -ne 0 ]; then - exit 1 -fi - -popd > /dev/null - -exit 0 diff --git a/rpms/awips2.qpid/0.30/SOURCES/qpid-client-0.30-bin.tar.gz b/rpms/awips2.qpid/0.30/SOURCES/qpid-client-0.30-bin.tar.gz deleted file mode 100644 index 7e13e3e8d7..0000000000 Binary files a/rpms/awips2.qpid/0.30/SOURCES/qpid-client-0.30-bin.tar.gz and /dev/null differ diff --git a/rpms/awips2.qpid/0.30/SOURCES/qpid-cpp-0.30.tar.gz b/rpms/awips2.qpid/0.30/SOURCES/qpid-cpp-0.30.tar.gz deleted file mode 100644 index 480c756487..0000000000 Binary files a/rpms/awips2.qpid/0.30/SOURCES/qpid-cpp-0.30.tar.gz and /dev/null differ diff --git a/rpms/awips2.qpid/0.30/SPECS/qpid-java.spec b/rpms/awips2.qpid/0.30/SPECS/qpid-java.spec deleted file mode 100644 index 247d1f0b31..0000000000 --- a/rpms/awips2.qpid/0.30/SPECS/qpid-java.spec +++ /dev/null @@ -1,86 +0,0 @@ -%define _awips2_directory "/awips2/qpid" - -Name: awips2-qpid-java -Version: 0.30 -Release: 1%{?dist} -Summary: Java implementation of Apache Qpid -License: Apache Software License -Group: Development/Java -URL: http://qpid.apache.org/ - -%global qpid_src_dir qpid-client-%{version}-bin -%global qpid_client_dir qpid-client - -Source: %{qpid_src_dir}.tar.gz - -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) -BuildArch: noarch - -%description -Java implementation of Apache Qpid. - -%package common -Summary: Java implementation of Apache Qpid - common files -Group: Development/Java -BuildArch: noarch - -%description common -Java implementation of Apache Qpid - common files - -%package client -Summary: Java implementation of Apache Qpid - client -Group: Development/Java -BuildArch: noarch -Requires: awips2-qpid-java-common = %{version}-%{release} -Requires: log4j >= 1.2.12 - -%description client -Java implementation of Apache Qpid - client - -%prep -%setup -q -n %{qpid_client_dir} - -%build - -%install -rm -rf %{buildroot} - -cd .. - -install -dm 755 %{buildroot}%{_awips2_directory}/lib/opt -install -pm 644 %{qpid_client_dir}/%{version}/lib/qpid-client-%{version}.jar \ - %{buildroot}%{_awips2_directory}/lib/opt -install -pm 644 %{qpid_client_dir}/%{version}/lib/qpid-common-%{version}.jar \ - %{buildroot}%{_awips2_directory}/lib/opt -install -pm 644 %{qpid_client_dir}/%{version}/lib/geronimo-jms_1.1_spec-1.1.1.jar \ - %{buildroot}%{_awips2_directory}/lib/opt -install -pm 644 %{qpid_client_dir}/%{version}/lib/slf4j-api-1.6.4.jar \ - %{buildroot}%{_awips2_directory}/lib/opt - -# license & notice -install -pm 644 %{qpid_client_dir}/%{version}/LICENSE \ - %{buildroot}%{_awips2_directory} -install -pm 644 %{qpid_client_dir}/%{version}/NOTICE \ - %{buildroot}%{_awips2_directory} - -%clean -rm -rf %{buildroot} - -%files common -%defattr(-,awips,fxalpha,-) -%dir /awips2/qpid -%dir /awips2/qpid/lib -%dir /awips2/qpid/lib/opt -/awips2/qpid/lib/opt/qpid-common-%{version}.jar -/awips2/qpid/lib/opt/geronimo-jms_1.1_spec-1.1.1.jar -/awips2/qpid/lib/opt/slf4j-api-1.6.4.jar -%doc /awips2/qpid/LICENSE -%doc /awips2/qpid/NOTICE - -%files client -%defattr(-,awips,fxalpha,-) -%dir /awips2/qpid -%dir /awips2/qpid/lib -%dir /awips2/qpid/lib/opt -/awips2/qpid/lib/opt/qpid-client-%{version}.jar - diff --git a/rpms/awips2.qpid/0.30/SPECS/qpid-lib.spec b/rpms/awips2.qpid/0.30/SPECS/qpid-lib.spec deleted file mode 100644 index 2d605cac78..0000000000 --- a/rpms/awips2.qpid/0.30/SPECS/qpid-lib.spec +++ /dev/null @@ -1,127 +0,0 @@ -%define _build_arch %(uname -i) -%define _qpid_version 0.30 -%define _qpid_build_loc %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) -%global qpid_src_dir qpid-cpp-%{version} -# -# AWIPS II QPID native Spec File -# - -Name: awips2-qpid-lib -Summary: AWIPS II QPID Native Library Distribution -Version: %{_qpid_version} -Release: 0.30 -Group: AWIPSII -BuildRoot: %{_build_root} -BuildArch: %{_build_arch} -URL: N/A -License: N/A -Distribution: N/A -Vendor: Raytheon -Packager: Bryan Kowal - -Source0: %{qpid_src_dir}.tar.gz - -AutoReq: no -BuildRequires: awips2-python -provides: awips2-qpid-lib - -%description -AWIPS II QPID Lib Distribution - Contains the qpid shared libraries and -header files for qpid %{_qpid_version}. - -%prep -# Ensure that a "buildroot" has been specified. -if [ "%{_build_root}" = "" ]; then - echo "ERROR: A BuildRoot has not been specified." - echo "FATAL: Unable to Continue ... Terminating." - exit 1 -fi - -if [ -d %{_build_root} ]; then - rm -rf %{_build_root} -fi -if [ -d %{_qpid_build_loc} ]; then - rm -rf %{_qpid_build_loc} -fi -mkdir -p %{_qpid_build_loc} -if [ $? -ne 0 ]; then - exit 1 -fi - -cp -v %SOURCE0 %{_qpid_build_loc} -if [ $? -ne 0 ]; then - exit 1 -fi - -pushd . > /dev/null 2>&1 -cd %{_qpid_build_loc} -tar -xvf %SOURCE0 -if [ $? -ne 0 ]; then - exit 1 -fi -popd > /dev/null 2>&1 - -%build -pushd . > /dev/null 2>&1 - -mkdir -p %{_qpid_build_loc}/build -if [ $? -ne 0 ]; then - exit 1 -fi - -cd %{_qpid_build_loc}/build - -cmake %{_qpid_build_loc}/%{qpid_src_dir} -DCMAKE_INSTALL_PREFIX:PATH=%{_qpid_build_loc}/awips2/qpid -if [ $? -ne 0 ]; then - exit 1 -fi - -make all -if [ $? -ne 0 ]; then - exit 1 -fi -popd > /dev/null 2>&1 - -%install -/bin/mkdir -p %{_qpid_build_loc}/awips2/qpid -if [ $? -ne 0 ]; then - exit 1 -fi - -pushd . > /dev/null 2>&1 -cd %{_qpid_build_loc}/build -make install -if [ $? -ne 0 ]; then - exit 1 -fi -popd > /dev/null 2>&1 - -/bin/mkdir -p %{_build_root}/awips2/qpid -if [ $? -ne 0 ]; then - exit 1 -fi - -# copy qpid lib and include directories. -/bin/cp -rv %{_qpid_build_loc}/awips2/qpid/lib \ - %{_build_root}/awips2/qpid -/bin/cp -rv %{_qpid_build_loc}/awips2/qpid/lib64/* \ - %{_build_root}/awips2/qpid/lib -/bin/cp -rv %{_qpid_build_loc}/awips2/qpid/include \ - %{_build_root}/awips2/qpid - -%pre -%post -%preun -%postun - -%clean -rm -rf ${RPM_BUILD_ROOT} -rm -rf %{_qpid_build_loc} - -%files -%defattr(644,awips,fxalpha,755) -%dir /awips2/qpid -%dir /awips2/qpid/lib -/awips2/qpid/lib/* -%dir /awips2/qpid/include -/awips2/qpid/include/* diff --git a/rpms/awips2.qpid/0.30/deploy.builder/build.sh b/rpms/awips2.qpid/0.30/deploy.builder/build.sh deleted file mode 100644 index d407d46ea4..0000000000 --- a/rpms/awips2.qpid/0.30/deploy.builder/build.sh +++ /dev/null @@ -1,60 +0,0 @@ -#!/bin/bash - -# Verify that the workspace has been specified -if [ -z ${WORKSPACE} ]; then - echo "Error: the location of the baseline workspace must be specified using the WORKSPACE environment variable." - exit 1 -fi -if [ -z ${AWIPSII_BUILD_ROOT} ]; then - export AWIPSII_BUILD_ROOT="/tmp/${USER}/awips-component" - echo "INFO: using default build root - ${AWIPSII_BUILD_ROOT}." -fi - -pushd . > /dev/null -cd ../ -export TOPDIR=`pwd` - -# create the rpm directory structure -if [ -d ${TOPDIR}/BUILD ]; then - rm -rf ${TOPDIR}/BUILD - if [ $? -ne 0 ]; then - exit 1 - fi -fi -mkdir ${TOPDIR}/BUILD -if [ -d ${TOPDIR}/RPMS ]; then - rm -rf ${TOPDIR}/RPMS - if [ $? -ne 0 ]; then - exit 1 - fi -fi -mkdir ${TOPDIR}/RPMS -if [ -d ${TOPDIR}/SRPMS ]; then - rm -rf ${TOPDIR}/SRPMS - if [ $? -ne 0 ]; then - exit 1 - fi -fi -mkdir ${TOPDIR}/SRPMS - -# build the rpm -rpmbuild -ba \ - --define "_topdir ${TOPDIR}" \ - --define "_baseline_workspace ${WORKSPACE}" \ - SPECS/qpid-java.spec -if [ $? -ne 0 ]; then - exit 1 -fi -rpmbuild -ba \ - --define "_topdir ${TOPDIR}" \ - --define "_baseline_workspace ${WORKSPACE}" \ - --define "_build_root ${AWIPSII_BUILD_ROOT}" \ - --buildroot ${AWIPSII_BUILD_ROOT} \ - SPECS/qpid-lib.spec -if [ $? -ne 0 ]; then - exit 1 -fi - -popd > /dev/null - -exit 0 diff --git a/rpms/build/common/rpms.sh b/rpms/build/common/rpms.sh index c949b928f4..00ef5a8f1a 100644 --- a/rpms/build/common/rpms.sh +++ b/rpms/build/common/rpms.sh @@ -65,7 +65,7 @@ function buildQPID() fi fi - cd ${WORKSPACE}/rpms/awips2.qpid/0.30/deploy.builder + cd ${WORKSPACE}/installers/RPMs/qpid-lib-0.30 if [ $? -ne 0 ]; then echo "ERROR: Failed to build the qpid rpms." return 1 @@ -77,27 +77,6 @@ function buildQPID() return 1 fi - # Copy the 0.30 qpid rpms - cd ${WORKSPACE}/rpms/awips2.qpid/0.30/RPMS/noarch - if [ $? -ne 0 ]; then - echo "ERROR: Failed to build Qpid v0.30." - return 1 - fi - /bin/cp -v *.rpm ${AWIPSII_TOP_DIR}/RPMS/noarch - if [ $? -ne 0 ]; then - return 1 - fi - - cd ${WORKSPACE}/rpms/awips2.qpid/0.30/RPMS/x86_64 - if [ $? -ne 0 ]; then - echo "ERROR: Failed to build Qpid v0.30." - return 1 - fi - /bin/cp -v *.rpm ${AWIPSII_TOP_DIR}/RPMS/x86_64 - if [ $? -ne 0 ]; then - return 1 - fi - #build 0.30 export AWIPS_II_TOP_DIR cd ${WORKSPACE}/installers/RPMs/qpid-java-broker-0.30